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 / Show/Hide Button based...
Power Apps
Answered

Show/Hide Button based on User Email Address for multiple different Users

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a Button that I only want to show for particular users within the organization. I have the following set up on the "Visible" Property of the Button:

If(Lower(User().Email)="user1@microsoft.com"||"user2@microsoft.com"||"user3@microsoft.com"||"user4@microsoft.com || "user5@microsoft.com" || "user6@microsoft.com" || "user7@microsoft.com",true,false)

I have also tried:

  • Setting up the User Email Address on App StartUp, defined as "UserEmailAddress" and using the Text results of that parameter in the same way.
  • Adding a Field on the form which shows the logged-in UserID's email address and using the Text result of that parameter in the same way.

However none of these scenarios are working and I cannot determine a root cause for this,. Any pointers would be greatly appreciated - Thanks!

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You cannot OR on multiple value like that.  Each must be a complete or of User email to value.

     

    You will have much better control in your app if you do the following:

    Instead of doing this in the Visible property (and potentially the visible property of many other controls).  Set a global variable in your OnStart like this:

    Set(glbAdmin, 
     Lower(User().Email) in 
     "user1@microsoft.com|user2@microsoft.com|user3@microsoft.com|user4@microsoft.com|user5@microsoft.com|user6@microsoft.com|user7@microsoft.com"
    )

    Note, the difference here from your formula is that all of the emails are put together in one string.  The in operator is used to determine if the lower case email of the user is in that string.  If so, then the entire formula will resolve to true, and thus glbAdmin will be true.

     

    Now, in your Visible property simply put this: glbAdmin

     

    There is nothing else needed.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you - that worked!

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