cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jharville
Helper V
Helper V

Only show Button (Visible) to certain email address domains

Hello everyone!

 

I have a button on my screen that I do not want visible to people with the '@gmail.com' email address domain. How would I do this?

 

Thank you 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@jharville 

For simplicity in the app (the ability to maintain easily), I would set a global variable in the OnStart action of the App.

Set(glbUnRestricted, !("gmail.com" in User().Email))

Then on the button, just set the Visible property to: glbUnRestricted

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
rsaikrishna
Community Champion
Community Champion

@jharville 

 

You can create a collection with all such email domains and place it in OnStart.

Set(varCurrentUserEmail, ToLower(User().Email));

ClearCollect(colAvoidEmailDomains, ["gmail.com","yahoo.com"])

 

In the Button's visible property, place following formula:

If(varCurrentUserEmail in colAvoidEmailDomains, false,true)

 

I hope this helps you.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
RandyHayes
Super User
Super User

@jharville 

For simplicity in the app (the ability to maintain easily), I would set a global variable in the OnStart action of the App.

Set(glbUnRestricted, !("gmail.com" in User().Email))

Then on the button, just set the Visible property to: glbUnRestricted

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,675)