Tuesday, March 24, 2026

How to Retrieve Security Role based on Access in Dataverse using FetchXML ?

 Introduction:


In tis blog, we will see how to Retrieve Security Role based on Access in Dataverse using FetchXML ?

Implementation Steps:

  • Navigate to https://make.powerautomate.com

  • Click New Flow

  • Create an Instant Cloud flow

  • Add Input Parameter as Name (to query what type of Access with Table Name)

  • Same Formatting to pass as Input Parameter

  • prv + AccessType + TableLogicalName
    • prv - Prefix
    • AccessType - What type of access?
      • Read
      • Write
      • Create
      • Append 
      • AppendTo
      • Share
      • Assign
    • TableName - Which table to query?
      • Account
      • Contact
      • etc
  • Now Add List Rows
    • Add Table Name as Security Role

      <fetch> 
      <entity name="role"> <attribute name="name" /> 
      <attribute name="roleid" /> 
      <link-entity name="roleprivileges" from="roleid" to="roleid" alias="rp"> 
      <attribute name="privilegedepthmask" /> 
      <link-entity name="privilege" from="privilegeid" to="privilegeid"> 
      <filter> 
      <condition attribute="name" operator="eq" value="prvReadAccount" /> 
      </filter> 
      </link-entity> 
      </link-entity>
      </entity> 
      </fetch>
  • In the above query am passing prvReadAccount
    • Am getting all security roles having Read Permission of Account

  • Save and Run

  • Sample image of Power Automate




  • Sample Output




  • Output comes with Security Role Name and Privilege id as well

    Sample Privilege copied for ChatGPT




Conclusion:

That's it, try using this approach to quickly retrieve tables and their permission levels.

No comments:

Post a Comment

How to Clear Cache in Canvas PowerApps while working on Offline mode?

  Introduction In this blog, we’ll look at how to clear cache in Canvas Apps when using the Power Apps mobile application, especially when t...