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 / Make button visible to...
Power Apps
Answered

Make button visible to only 3 specific users

(0) ShareShare
ReportReport
Posted on by 222

I'm going batty. I have found many posts and blogs on how to do it and no one tells you the same thing twice. I cannot for the life of me figure out how to hide 1 button from everyone except 3 specific people. It's a button that goes to a new screen and we want to test the feedback survey on that screen. If you are a tester, you will see the button at the bottom of the landing page and no one else. I have tried:

  • Hardcoding the tester on the button
  • Setting the tester as a variable and using the variable
  • Looking up a SharePoint list of testers (list is called "Testers", the Title field is the username the Email column is a people picker showing the work email)

I am doing all of this on the OnStart of the app:

Set(
VarUser,
User()
);
Set(
varUserEmail,
User().Email
);
Collect(
SPTesterList,
Testers
);
Set(
varTesterEmail,
varUserEmail = "first.last@company.com"

);

I am not creating a record. I'm doing all of that, but I can't find the right expression to do something with it. Either the button is hidden at all times or it's visible at all times. What am I doing wrong?

What doesn't work:

  • Collect(SPTesterList, Testers); Set(currentUser,User()) ; Set(varTesterEmail,LookUp(SPTesterList,Email=currentUser.Email))
  • Set(varTesterEmail, varUserEmail = "first.last@company.com");
  • If(User().Email = "first.last@company.com" || "first.last@company.com", true,false)
  • If(User().Email = "first.last@company.com", true,false)

Any suggestions would be welcome.

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @ACPBSCi

    Visible property of button:

    User(). Email = joe@contoso.com||

    Mary@microsoft.com || bill@usa.gov

  • Verified answer
    mmollet Profile Picture
    3,187 on at

    User() is a global function that is always available so you dont need to save it to a variable and do anything fancy with it. Just set the visibility to User().Email = firstemail or User().Email = secondemail or User().Email = thirdemail

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @mmollet 

    Brilliant!

  • mmollet Profile Picture
    3,187 on at

    @Drrickryp 

    *facepalm 

    Didn't see you had literally said the exact same thing before me lol I started to answer then had a work call and came back to finish after. Guess I should start refreshing before I answer when I have to walk away for a bit. 😅

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    1. Smilegif.gif

       

  • Verified answer
    ACPBSCi Profile Picture
    222 on at

    This doesn't work. I get an error that says incompatible types. You have to put quotes around the email address.

    "first.last@company.com". I wish this was more intuitive. It worked, though. Thank you. I swear I tried this. I knew it was simple.

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 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard