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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,192)