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 / Button Click to be all...
Power Apps
Unanswered

Button Click to be allowed to Specific Users

(0) ShareShare
ReportReport
Posted on by 207

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

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,327 Most Valuable Professional on at

    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

  • VishalJhaveri Profile Picture
    1,169 Moderator on at

    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.

  • DineshK_ Profile Picture
    207 on at

    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 ..

     

    Thanks

    DK

  • WarrenBelz Profile Picture
    156,327 Most Valuable Professional on at

    Hi @DineshK_ ,

    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.

     

    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

     

  • DineshK_ Profile Picture
    207 on at

    Seems something wrong .. not able to define Role field ..

     

    DineshK__0-1715601455475.png

     

    Sharepoint list :

     

    DineshK__1-1715601481503.png

     

  • WarrenBelz Profile Picture
    156,327 Most Valuable Professional on at

    Hi @DineshK_ ,

    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"
    )

     

    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

     

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
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard