web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to set the button ...
Power Apps
Answered

How to set the button permission in Power APPS

(0) ShareShare
ReportReport
Posted on by 6

I have a role table like this:

airma_0-1703812573227.png

and I want to set the permission in power apps for a button that only admin can see, and the script APP onsart like below, and the varUser email always show blank , how can I solve this?

airma_3-1703812982268.png

 

airma_2-1703812926151.png

 

airma_1-1703812900127.png

 

Categories:
I have the same question (0)
  • Samuel-Zhou Profile Picture
    393 on at

    @airma It's more likely a permissions issue. You can create a collection and try it out.

    Put all the code into the button.

     

    ClearCollect(Role,{User:"Test@aaa.com.tw",Role:"Admin",__Power:"1234567",ssid:"aaaa"});
    Set(
     varUserMail,
     User().Email
    );
    Set(
     varAdmin,
     LookUp(
     Role,
     User = varUserMail
     ).Role = "Admin"
    )

     

  • Verified answer
    v-jefferni Profile Picture
    on at

    Hi @airma ,

     

    Have you triggered the OnStart after setting the variable?

    vjefferni_0-1703831667033.png

     

    Best regards,

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    u you work with entra id groups?

     

    if yes you can out that in the onvisible of your first screen:

     

     

     

    Set( 
    
     varIsOwner, 
    
     User().Email in Office365Groups.ListGroupMembers("YOUR ENTRA ID GROUP ID").value.mail 
    
    ); 

     

     

    in the buttons you want to show only to the person who matches this you only put varIsOwner

     

    if you need more assistance let me know

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • airma Profile Picture
    6 on at

    Thank you Jefferni,I just start to create apps and don't know should run OnStart first   , after I click this the issue fixed!!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard