cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Button visible only for specific users (by email)

Hello,

 

I would like to have a specific button visible only for a particular group of users. I would like to use email addresses as a variable.

So far I have used the following: If(User().Email="user@xxx.com" || User().Email="user2@xxx.com" || ;true;false)

 

Unfortunately, not all users can see it (only the first one). Is there any possibility to for example use excel list and put all email addresses there, and then the button will be visible only for users that are included in Excel?

I need to make this button visible for around 50 users and the app will be used by over 300.

 

Maybe other ideas from your experience?

 

Many thanks,

Bartek

10 REPLIES 10
Highlighted
Super User III
Super User III

Assuming you have a UserTable, add another column2 for usersGroup. Then put the various groups you want.

In Powerapps, OnStart, Set the variable;

Set(LoggedGroup, LookUp(UserTable, Emailcolumn=User().Email,GroupColumn))

The variable hold the group belonging to the user currently logged in.

 

Then on the Visible of the button you want to hide, put the name of that group that have permission to see example:

If(LoggedGroup=Group1,true,false)

 

Group1 is the group that can view the button

Hope this helps

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

Highlighted

@eka24thank you, how do I define group1? My column with email addresses is called email and another one member (where there is "yes"). Only people that should have the access to this button are listed in the excel list.

Highlighted

Can you show sample of your table possibly, a screen shot

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

@eka24attached

Highlighted

Assuming Member is the column that will have yes and no for those who will see or not see the button:


In Powerapps, OnStart, Set the variable;

Set(LoggedGroup, LookUp(UserTable, Email=User().Email,Member))

The variable hold the "yes" if the member column for the user is yes. Same for "no"

 

Then on the Visible of the button you want to hide:

If(LoggedGroup="yes",true,false)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

@eka24  now the button does not have an error but my email is included in the list with member as yes, but the button is not visible for me

Highlighted

Did you restart the app?

To test whether the variable works, Insert a textbox and on Default put: LoggedGroup

Now check the what comes up in the textbox whether "Yes" or "yes" or Nothing

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

@eka24  it shows "false"

Highlighted

Is the email in your table office365 email?

Also apart from "yes", what else do you have in the column "No", only two options?

Am asking because you showed only a line of your table.

Finally can you show a screen shot of the formula you used

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,282)