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 Automate / Dataverse: Trigger flo...
Power Automate
Suggested Answer

Dataverse: Trigger flow when user security role changes

(1) ShareShare
ReportReport
Posted on by 303
I am trying to trigger a flow when a user is assigned or unassigned a security role in Dataverse.
This sort of change is written to the System User Role table; however, this is table is not available for selection in the Dataverse trigger.
I did try manually entering the table name (systemuserroles) into the trigger and subsequent actions confirmed PA could see the table, it just could not trigger the flow.
Has anyone been able to trigger a flow when a user is assigned or unassigned a security role in Dataverse?
I found Trigger Flow when a security role assigned to user in Dataverse (powerplatform.com) but this is clearly not the answer as it is triggering on when a security role is created.
 
Thanks!
 
Categories:
I have the same question (0)
  • gavilap Profile Picture
    3 on at
    I'm in the same situation, did you manage to solve it?
  • Gprior Profile Picture
    184 on at
    Hello there,
    same problem here!
     
    Have you found a solution?
     
    Thank you!
    Giovanni
  • donalmc Profile Picture
    303 on at
    Sorry @Gprior and @gavilap - I was not able to get anywhere with this
  • Suggested answer
    Gprior Profile Picture
    184 on at
    Hi there,
    just a quick update on this topic based on what i found.
     
    In Microsoft Dataverse, you cannot directly trigger a Power Automate flow when a security role is assigned to a user, because the systemuserroles (user-security role linking) table is not enabled for change tracking, auditing, or triggering flows directly.
     
    I was not able to go deeper than that, but i've done extensive tests and i've not been able to trigger any flow when i change security roles. Based on suggestion of user Stampcoin on a topic i've opened as well (direct link), one suggested solution would be to check security role table on fixed schedule and save a picture of the records in a custom table to compare later.
     
    Otherwise there are more complex solutions but i'm not skilled enough or not allowed (e.g. to use a Plugin or Azure Function via Dataverse Webhook).
    I'll keep you updated in this.
     
    Giovanni
  • Suggested answer
    CU09120509-0 Profile Picture
    2 on at
    1. Create Manual flow or recurrence automate cloud flow as per need.
    2. List Environment as Admin
    3. Add condition to check the environment using environment variable
    4. Fetch teams and filter team for azure security group id
    5. Fetch related Users, filtering using teamid
    6. Fetch Security Roles while applying to each user
    7. Further, compose, do conversion for multiple roles for a user using join
    8. Create custom entity to store the iser and its security role related data
    9. In power automate flow, check condition if for any user, roles doesn’t exist
    10. If it does, list records from custom entity, filtering email eq useremail
    11. Lastly, check if the security roles you fetched for a user matches with the one in the custom entity record
    12. If not, it means roles are modified and thereafter, update the securityrole column for a user in custom entity for the fields such as, securityroles, modifieddate to utcn
  • @rtdlov Profile Picture
    16 on at
    Hey,
     
    I doubt there is a trigger for this, all Admin connectors (for Power Platform tools) have only actions.
     
    Regards,
     
    Artjoms

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard