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
Super User
Super User

@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 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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (2,163)