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 Apps / How can I get the list...
Power Apps
Unanswered

How can I get the list of Users my Model driven app is shared with?

(0) ShareShare
ReportReport
Posted on by 14

How can I get the list of Users my Model driven app is shared with?

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Hi @bhaski ,

     

    You can achieve this via Power Automate using the Get Role Assignments action by entering the App ID into the PowerApp Name field.

     

    Amik_0-1686751696574.png

     

    Amik_1-1686751725790.png

     

    Note the output is JSON, but you can add another action to export the data into Excel for example.

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

     

  • bhaski Profile Picture
    14 on at

    @Amik Unfortunately it does not work for me.
    error.PNG

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    Apologies @bhaski, I should have read the question properly!

     

    Model-driven apps use role-based security for sharing and I believe Get App Role Assignments action is only applicable for Canvas Apps.

     

    Another option is to return all users associated to a Security role using a Gallery. For example apply the below to the Items property of a Gallery and set one of the Labels to ThisItem.'Full Name'.

     

     

     

    LookUp(
     'Security Roles',
     Name = "Your Security Role Name"
    ).Users

     

     

     

    And then leverage Power Automate to export that data into Excel for example.

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • bhaski Profile Picture
    14 on at

    @Amik Thank you for your response. This is effective for a few security roles. But what if you have numerous security roles (in this case, 20)? Is there a PS script that can extract this data? I have several apps with multiple security roles, and entering each security role is a time-consuming process.

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @bhaski - not that I am aware of. @LinnZawWin & @dpoggemann may possibly have a few ideas.

     

     

     

  • Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @bhaski,

     

    Please see the following to get roles assigned to users which identifies users assigned to roles.  

    https://www.marksgroup.net/blog/dynamics-365-view-all-users-security-roles-at-once-with-the-user-summary-report/ 

     

    Thanks,

    Drew

  • Linn Zaw Win Profile Picture
    2,996 on at

    @bhaski 

    You can join the appmodule (Model-Driven App), role (security role) and systemuser (User) tables using the following FetchXML in FetchXML Builder tool to get the list of users who has the role which can access to the apps.

     

    <fetch>
     <entity name='appmodule'>
     <attribute name='name' />
     <link-entity name='appmoduleroles' from='appmoduleid' to='appmoduleid' intersect='true'>
     <link-entity name='role' from='roleid' to='roleid' alias='role' intersect='true'>
     <attribute name='name' />
     <link-entity name='systemuserroles' from='roleid' to='roleid' intersect='true'>
     <link-entity name='systemuser' from='systemuserid' to='systemuserid' alias='systemuser' intersect='true'>
     <attribute name='fullname' />
     </link-entity>
     </link-entity>
     </link-entity>
     </link-entity>
     </entity>
    </fetch>

     

    The result would look something like this.

    LinnZawWin_0-1687279658668.png

     

     

  • Tetris Profile Picture
    72 on at

    Hi @Amik. I tried using the Get App Roles action in a workflow and got a failure and the message:

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
    <HTML><HEAD><TITLE>Bad Request</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
    <BODY><h2>Bad Request - Invalid URL</h2>
    <hr><p>HTTP Error 400. The request URL is invalid.</p>
    </BODY></HTML>

     

    Do you know what may generate this error and how to fix it?

     

    Thank you

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Salv a workflow or Power Automate Flow?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard