Expand my Community achievements bar.

SOLVED

Using Fusion to update userRoles for users?

Avatar

Community Advisor

I have a job role I need to apply to several 100 users in the Other roles area as they all have primary roles.  I was hoping to do this via Fusion but I've not been able to figure out how to update the USRROL properly for a user.  Anyone have experience doing an update like this to provide a bit of guidance?

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

I think I saw similar question already and I was answering it. Anyway

We have this custom API module to update roles:

Rafal_Bainie_0-1735029280744.png

as you can notice user Roles are updated with JSON string that you need to prepare like that:

Rafal_Bainie_1-1735029346981.png

 

and output of this usually looks like this:

Rafal_Bainie_2-1735029397311.png

hope this is helpful

 

View solution in original post

7 Replies

Avatar

Community Advisor

 

Hi @Kurt_Jones,

 

I look forward to learning The Right Way from some other kind responder, but until then....

 

Under some duress, I once created a loop to keep changing each user's primary role through all of their roles, "spinning off" each replacement as an otherRole in so doing, then being careful to ensure that the Wheel-Of-Fortune stopped spinning on what was their correct Primary Role.

 

Regards,

Doug

Avatar

Community Advisor

I don't have an answer for you, but I wanted to let you know there's a similar question on the Fusion practice exam. In that case, the question was about adding more than one custom form to a project, since you can only do the primary using the native module.

 

The answer was to use a custom API call using objectCategories, so I assume the same would hold for you (using userRoles). You mentioned USRROL, so I assumed you're trying a native module as well, but please correct me if I assumed wrong.

Avatar

Community Advisor

Thanks Skye, yea, I've been trying via custom API, the userRoles is a nested collection under USER and I've been struggling to find the right JSON structure, if there is one, to allow a POST or PUT to happen to that field.  I'll keep trying and post back if I have any success but to date, not yet.

Avatar

Level 1

You can update user roles in bulk using PowerShell scripts or the Graph API. If Fusion doesn't support direct updates to the USRROL, these methods allow you to automate the process and apply the role across multiple users. Let me know if you need help with the specific commands or setup!

Avatar

Community Advisor

AlexRose69, I'm not familiar with PowerShell or Graph API but if you have any resources/information on how to use them to update the USRROL object I'm willing to give it a try.  Thanks for the insight.

Avatar

Correct answer by
Community Advisor

I think I saw similar question already and I was answering it. Anyway

We have this custom API module to update roles:

Rafal_Bainie_0-1735029280744.png

as you can notice user Roles are updated with JSON string that you need to prepare like that:

Rafal_Bainie_1-1735029346981.png

 

and output of this usually looks like this:

Rafal_Bainie_2-1735029397311.png

hope this is helpful