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 not showing wit...
Power Apps
Answered

Button not showing with user "permissions"

(0) ShareShare
ReportReport
Posted on by 6

Hello everyone,

 

I've got a button with the following "Visible" function: "

 

If(User().Email = "email@domain.com" && "email2@domain.com" && "email3@domain.com" && "email4@domain.com" && "email5@domain.com"; true; false)

 

 

I want the button to be visible only to these 5 users. With this code, the button is not loading to any of these users.

Can you please help me or guide me?

TKs!

 

Rui Jacome 

Categories:
  • WarrenBelz Profile Picture
    156,756 Most Valuable Professional on at

    Hi @rjacome ,

    Close - you need Or ||, nor And() && and you do not need the If statement as this is a Boolean formula. The Visible of the button can be<

    User().Email = "email@domain.com" || User().Email = "email2@domain.com" || User().Email = "email3@domain.com" || User().Email = "email4@domain.com" || User().Email = "email5@domain.com"

    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.

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @rjacome ,

    Based on the formula you provided, I think there is something wrong with it. You should not use the "&&" operator within your If function, instead, you should use "||" operator.

     

    More details about the difference between the "&&" operator and "||" operator, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/operators

     

    I have made a test on my side, please consider take a try with the following formula (set the Visible property of button to following😞

    If(
     User().Email = "email@domain.com" || User().Email = "email2@domain.com" || User().Email= "email3@domain.com" || User().Email= "email4@domain.com" || User().Email= "email5@domain.com"; 
     true; 
     false
    )

     

    In addition, you could also consider save these email address into a table, then you could compare current sign user email with the Table. You could also take a try with the following formula:

    If(
     User().Email in ["email@domain.com", "email2@domain.com", "email3@domain.com", "email4@domain.com", "email5@domain.com"]; 
     true; 
     false
    )

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

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

    Thanks @v-xida-msft for confirming my logic.

    @rjacome the true,false will work as well, but you do not need it if simply setting Visible property as the Boolean result (true/false) will be reflected directly in the visibility of the control. The table option will also work and is essentially the same query.

     

    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.

  • rjacome Profile Picture
    6 on at

    Hi,

     

    Currently i'm using your code, and the button is only visible to the first user.. All the other cannot see the button.

    😞

     

    Rui Jacome

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @rjacome ,

    Please modify your formula as below:

    If(
     Lower(User().Email) = Lower("email@domain.com") || Lower(User().Email) = Lower("email2@domain.com") || Lower(User().Email) = Lower("email3@domain.com") || Lower(User().Email)= Lower("email4@domain.com") || Lower(User().Email) = Lower("email5@domain.com"); 
     true; 
     false
    )

     

    In addition, you could also consider save these email address into a table, then you could compare current sign user email with the Table. You could also take a try with the following formula:

    If(
     Lower(User().Email) in Lower(["email@domain.com", "email2@domain.com", "email3@domain.com", "email4@domain.com", "email5@domain.com"]); 
     true; 
     false
    )

    Please take a try with above solution, check if the issue is solved.

     

    Also please make sure you have specified proper email address within your app. Please note that the email address is Case Sensitive in canvas app.

     

    Best regards,

  • Verified answer
    WarrenBelz Profile Picture
    156,756 Most Valuable Professional on at

    Hi @rjacome ,

    Sorry - error in my code - I have fixed so not to confuse people reading it - in addition are all the user emails spelt exactly as per your hard coding, including the case sensitivity. It is also a good idea to avoid the delegation issues of User().Email. So at App OnStart, put this 

    Set(vUserMail,User().Email)

    Then in your Visible on the button<

    Lower(User().Email) = "email@domain.com" || Lower(User().Email)= "email2@domain.com" || Lower(User().Email)= "email3@domain.com" || Lower(User().Email)= "email4@domain.com" || Lower(User().Email)= "email5@domain.com"

    and ensure all your hard coding is in lower case as above.

     

    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.

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard