Hello PowerApps wizards,
I'd like to have certain items in my app be visible to a designated user based on a SharePoint list. If the current logged-in user matches a specific Title Column's Assigned Role, they would have full access/visibility of other features within the app. All other users would not have the same access or visibility. (I hope that makes sense).
So, Item A(red box) is the current logged in user, Item B is the value of "Role Assigned 1" based off the dropdown value (Item C, in purple). Whichever Office365 User is assigned the role of "Scribe/Room Coordinator", should be able to view the Button to the left of A and B. The end goal is to use that same formula for lots of buttons and features throughout the app.
Per usual, I'm sure there will be follow up questions to better understand my poor attempts at explaining my dilemma. So thanks in advance for the help!
Store current logged in user's department in a variable.
Set button's Visible property to
Variable="Scribe/Room Coordinator"
button will be only visible to person who has this department
@zmansuri the issue I see with that method is that the person assigned to "Scribe/Room Coordinator" may change from time to time in the DateTable that is in the picture. It isn't a title that is linked to a current user's Office365 account in order to make it a variable. How can I set whatever value is in the "Scribe/Room Coordinator" Role Assigned 1 Column to a variable?
This is fairly straightforward that you want to gather the permissions/roles of the user on startup and then utilize that in your app.
So, for example, in your OnStart:
Set(glbRole, LookUp('EOC People CheckList', StartsWith(UserEmail, User().Email), 'Role Assigned'))
Then, assuming you have Scribe/Room Coordinator in the Role Assigned column for that user email (note, base your data on email, not display name - display name is not unique, but email is)
Then on your controls in the app, you can set the Visible property to formulas such as this:
glbRole = "Scribe/Room Coordinator"
This would show that control for any user in that role.
NOW, this is all going to depend a lot on how you are storing your records in the People Checklist.
Will there be one role per person, or will there be multiple records in the list for a single person?
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
197 | |
69 | |
47 | |
36 | |
25 |
User | Count |
---|---|
239 | |
109 | |
89 | |
88 | |
66 |