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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Is it possible to dyna...
Power Pages
Answered

Is it possible to dynamically add users to a web role?

(0) ShareShare
ReportReport
Posted on by 54
I have a scenario where I want to automatically give users access to specific sections of content in the Portal if they entire a one-time code in a form. Is it
possible to let users dynamically add themselves to a web role by redeeming a code? I figure this may necessitate some kind of Power Automate flow but don’t even know if this is possible.
Categories:
  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @dehmos27 ,

    Unfortunately, we couldn't do it in Power Automate at present. Because the relationship between Contact and WebRole is N:N and there is no way to establish many-to-many relationships in the Flow.

    However, you can have a workaround by creating the out of box workflows.

    1. Add a custom Text field in Contact entity to store codes

    2. Create a workflow, starts when the record is created and the code field is changed.

    3. Add a Check Condition step, add some validation mechanisms to newly created code fields

    4. Add Portal - Assign Web Role step, choose the web role you want to assign when the condition meets.

    assign the web roleassign the web roleCheck ConditionCheck Condition

    Hope this helps.

    Sik

     

  • dehmos27 Profile Picture
    54 on at
    This seems like it will be a great fit. I’ll give this a whirl and let you know what I come up with.

    In the meantime, will this allow users to redeem multiple codes that give them access to multiple web roles as needed?
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @dehmos27 ,

     

    Yes, Contact and Web Role entity are many to many relationship, so the contact can be assigned with multiple web roles.

    My suggestion is to create another workflow to verify another code and assign anther web role.

    Just follow the above logic and steps, add another Code Field in Contact entity, and create workflow to assign another web role.

    These workflows can be triggered at the same time if all validations are met.

    Hope this helps.

    Sik

     

     

  • Newbie150 Profile Picture
    70 on at

    Has this capability been added to Power Automate Flow?  If so, does anyone have a solution to automatically add a web role to a portal user upon the creation of a new contact?

    Thank you!

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @Newbie150 

    This is the closed thread. Please create a new thread. Thanks for your understanding. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 35

#2
M Bilal Khan Profile Picture

M Bilal Khan 33

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard