Looking for some help with how to show an Authenticated users personally assigned entities from Dynamics CRM. I currently have the PowerApp connected and all the entities available, I am just struggling with how to have the information displayed only be what is currently assigned to the user accessing the PowerApp.
ex) I open App, select "Check My Access" button which takes me to a new page that displays certain assigned entities (Manager, Business Unit, Security Roles, Teams, etc).
Any help would be greatly appreciated! Thank you
Showing assignments like Security Roles and Teams should be doable. For instance, let's say you've stored the CDS user record in varUser. If you want to put a Gallery of the currently selected user's assigned roles on the form, you can set the Gallery Items to:
varUser.'Security Roles (systemuserroles_association)'
Showing a gallery of teams would work the same way. Manager and Business Unit are different, as those are simple lookup fields that can be displayed using a label control.
Are you looking for a way to view all privileges assigned to users? Not sure if you wanted to list all those within a canvas app, but a way is with the XrmToolBox Privilege Discovery tool: https://www.xrmtoolbox.com/plugins/MsCrmTools.SecurityRelated/
Hope this helps...
When you say "Stored the CDS user record in varUser" do you mean a Set function on the OnSelect? Also would the Gallery itself link to the Security Roles data source or Users data source?
In our case it looks like we use the general 'Users' dataset from the CDS so my Gallery Items looks like this:
Users.'Security Roles (systemuserroles_association)'
When I do this, I get the error "The Specified Column is not available in this context"
Not sure what I am doing wrong, but standard Filtering wont work due to the dataset size exceeding 2000 records (in Users dataset)
To your earlier question, there are any number of ways you can store a User record in a variable. The simplest might be to have a gallery of users and Set() the variable to whatever the selected user from that gallery is. Or, you could do a Lookup() on the Users entity if you have a known value as an input. Based on your question, I was assuming that you probably have a form for one user record, and that's where you are trying to insert a gallery of roles.
In my scenario, I said I had stored the User record in varUser, because we need to narrow our scenario down to just one user record. So when I have varUser.'Security Roles (systemuserroles_association)', I am essentially telling CDS to return the list of associated roles for the one user in varUser.
The challenge with Users.'Security Roles (systemuserroles_association)' is that you are essentially saying to CDS "return all the roles associated to all users", which I don't think CDS can make sense of.
Thank you for this information. If I wanted the stored user to be the current user accessing the app, as in no selection criteria on the app (just the user itself) how would that look with a Lookup or Set variable?
I appreciate all of your help! I am still very much a novice with PowerApps
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.