Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
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:
  • Peragin Profile Picture
    160 on at
    Re: Update current user web role through javascript

    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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43