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 Apps
Answered

Button Permissions

(0) ShareShare
ReportReport
Posted on by 519

Hello, 

I created some buttons on my landing screen and attempted to assign permissions to them.  I created a list in SharePoint called Admins and added the users to this list who should see certain buttons on the app.  I added myself to the user group and on the App - on Start created a variable for:  

Set(varUser,User()); Set(isUserAdmin, LookUp('Admins', Admins.Email = varUser.Email)) 

 

Then on the visibility property of the Dashboard button - set it to isUserAdmin.  Somehow this does not work and although I am in the list in SharePoint and when I mouse over the formula bar for varUser.Email it does show my email address, when I update the visibility property, the button disappears.  I am not sure what I am doing wrong.

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    The visible property needs to be true or false.  The isUserAdmin will either be blank or contain an email.  So to use that for the visibility use the following formula

    If(IsBlank(isUserAdmin),false,true)

     

  • joshieboy Profile Picture
    519 on at

    Hi Pstork1,

    Thanks for your feedback on this.  I tried the formula as directed above on my visible property for the button and the button just disappears.  Not sure what I am missing.  

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    If you set the Visible property to false then yes, the button will become invisible.  If you want it to just grey out then you need to use similar logic to set the DisplayMode property of the button to either DisplayMode.Edit or DisplayMode.Disabled.

  • joshieboy Profile Picture
    519 on at

    Oh sorry,

    I meant that I am a member of the Admin group, and so I thought that it would show for me.  I set the button visible property to the below as suggested and thought that it would show for me because I am a member in the group.  

     

    If(IsBlank(isUserAdmin),false,true)
     

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    If you are a member of the admin group did you check the value of isAdmin?  Your email should be in that variable. If its not then the logic is working but the Lookup to create isAdmin isn't.  The other possibility is that isAdmin has a record for a value.  If that is the case then change the formula to use isEmpty() instead of isBlank()

  • amit1030 Profile Picture
    34 on at

    Hi @joshieboy 

     

    You can use the below formula -

     

    Set(isUserAdmin, LookUp('Admins',  varUser.Email in Email));

     

    or try this 

     

     Set(isUserAdmin, LookUp('Admins', Email in varUser.Email));

     

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

  • joshieboy Profile Picture
    519 on at

    Hello,

    Somehow creating a variable on App start did not work for this.  It worked when I applied the formula directly to the visible property for the button.  

    If(IsBlank(LookUp('IIN Admins', Admins.DisplayName = varUser.FullName, Admins.DisplayName)),false,true)

    Thanks for all the assistance above though.  It was greatly appreciated.

  • Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    I don't think you can use a Lookup() in OnStart since the connectors won't be loaded yet.  YOu could move it to the OnVisible property of the main screen.  It should work from there.

  • Verified answer
    joshieboy Profile Picture
    519 on at

    Hi @Pstork1  - that is correct.  It worked well on the on visible property of the main screen.  Thanks again.  

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard