web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Update current user we...
Power Pages
Unanswered

Update current user web role through javascript

(0) ShareShare
ReportReport
Posted on by 167

Hi,

 

I'd like to be able to update the current user's web role through javascript and not through Portal Management. Has anyone done this? A sample code would be extremely helpful in understanding the set up required and I'd easily be able to adjust and refactor it to suit my requirement.

 

Thank you very much!

Categories:
I have the same question (0)
  • Peragin Profile Picture
    160 on at

    It's possible through power automate, you could trigger it off a record update or creation on dataverse from the portal, https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/378916/add-remove-webrole-from-contact-with-power-automate 

     

    Never tried it via the WebAPI but it may be possible:

    powerapps-docs/associate-disassociate-entities-using-web-api.md at main · MicrosoftDocs/powerapps-docs · GitHub

     

    Edit: Also, the user will need to logout and back in again for the new web role to take affect.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard