Announcements
Hi All ,
I want to restrict someone from the button which is not allowed someone to access/click . if they click it will say "Only for admins" like that.
For ex : Delete button to access only admins/managers.
Can you please help to achieve this task ?
Thanks
DK
Hi @DineshK_ ,
How do you determine if a user is an Admin/Manager ? If you already have a true/false Variable (I will call it gblIsAdmin here), you would put on the DisplayMode of the button
If( gblIsAdmin, DisplayMode.Edit, DisplayMode.Disabled )
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Set the Displaymode property to Disabled.
And provide the tooltip property of the button to show "Only for admins".
If my answer helps you, please mark it as solution.
Hi ,
Thanks for your response 🙂
I have a reference list of user names with roles as Admin / Members.
So i have to give access only to admin role users from the list.
In that case what can i do ?
Please help to achieve this ..
You did not specify what fields are in there, but assuming you have a Person field and a Role field, then at App OnStart
Set( gblIsAdmin, LookUp( YourSPList, PersonField.Email = User().Email ).Role = "Admin" )
then use the code I posted earlier.
Seems something wrong .. not able to define Role field ..
Sharepoint list :
That is because it is a Choice field - also Email is a bad name for a field as it is a Reserved Word in Power Apps and has the potential for Ambiguity.
Set( gblIsAdmin, LookUp( YourSPList, Email = User().Email ).Role.Value = "Admin" )
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 358 Most Valuable Professional
11manish 214 Super User 2026 Season 2
Mohsin Ali 179