Hi Team,
I was wondering if anyone can help.
I have a simple Powerapps gallery which is connected to a SharePoint List. The Gallery allows team members to Answer IT questions raised from employees.
The Gallery also has a "Delete" icon for each item which is supposed to be only visible for some of the senior team members, so they could delete a question from the gallery..
However I cannot get the Delete Icon to work for the senior team members. It works for me though.
On the "DisplayMode" of the Delete icon - I have used the following code:
If(User().Email="myemail@workemail.com" Or "Senior1@workemail.com" Or Senior2@workemail.com" Or "Senior3@workemail.com", DisplayMode.Edit,DisplayMode.View)
I don't know what I am doing wrong. The delete icon works perfectly for me but the senior team members they cannot click on the icon. They can see it but nothing else.
Solved! Go to Solution.
Hi @Manny123
Please try:
If(User().Email="myemail@workemail.com" Or User().Email="Senior1@workemail.com" Or User().Email=Senior2@workemail.com" Or User().Email="Senior3@workemail.com", DisplayMode.Edit,DisplayMode.View)
Hi @Manny123
Please try:
If(User().Email="myemail@workemail.com" Or User().Email="Senior1@workemail.com" Or User().Email=Senior2@workemail.com" Or User().Email="Senior3@workemail.com", DisplayMode.Edit,DisplayMode.View)
Does their email exactly match whatever you typed in your formula? If its capitalization is different than how you have it, it won't work for them. Also you missed a quotation by Senior2@workemail.com, but that could just be because you were giving us examples.
An alternative is to use the in function like so:
If(User().Email in ["myemail@workemail.com","Senior1@workemail.com","Senior2@workemail.com","Senior3@workemail.com"],
DisplayMode.Edit,
DisplayMode.View
)
If capitalization is an issue, you can specify everything in lower case like so:
If(Lower(User().Email) in ["myemail@workemail.com","senior1@workemail.com","senior2@workemail.com","senior3@workemail.com"],
DisplayMode.Edit,
DisplayMode.View
)
Thanks. This also works and can be used too! Well done.
Hi @Manny123
Glad that worked out for you!
One thing to note, if you will need to change the permissions to this button due to staff turnover, this will involve going in to edit your app each time and changing what is effectively hardcoded info - and you will need to republish the app each time you do this.
If you want to manage this list of people dynamically directly from within the app, you could set up a simple SharePoint list with these users in a person column adn then add something like the following in the visibility property of the delete icon.
!IsBlank(LookUp(PermissionsList, UserColumn.Email = User().Email))
Then add a simple admin screen in your app with gallery and form side by side to manage the permissions list with sample add/delete options - obviously you also want to limit access to that screen, so just use the same formula from above for the icon that will navigate users to that area.
Appreciate it's not the question you asked, but thought I would share it with you in case you find the concept useful for this or a future app.
Good luck with the rest of your build!
User | Count |
---|---|
256 | |
108 | |
97 | |
51 | |
39 |