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
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.
@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.
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.
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.
@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
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.
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
191 | |
45 | |
45 | |
36 | |
36 |
User | Count |
---|---|
261 | |
82 | |
80 | |
69 | |
69 |