cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mtwining1
Helper I
Helper I

Visible property

I have a button that I want to show when a user that is listed on a SharePoint site list with a column permission called admin.

 

the SharePoint list essentially is a list of users within an organization and permissions selected from a choice selection.

 

I want to give certain people a simple way to share certain features of my PowerApp. The best way I could think is to create a user maintenance page for them to add/edit/remove users in that SharePoint list from the app. I have it currently viewable to me and my boss emails so only we see it, but rather it be something that my boss does not need me to change should someone else need to use hidden features on the app.

 

Any ideas how to accomplish this?

2 ACCEPTED SOLUTIONS

Accepted Solutions
mtwining1
Helper I
Helper I

I found the issue could have been with the type of Column in the SharePoint list (People). So a workaround was I created a column as a single line text that copies the People column which was titled Username as a string, so it can compare in PowerApps Text to Text when using Lookup.

 

One button is based on the user actually being on the list.

!IsBlank(LookUp('ECR Coordinator App AD',CoName = Office365Users.MyProfile().DisplayName))

 

The other button is access to manage the list

!IsBlank(LookUp('ECR Coordinator App AD',CoName = Office365Users.MyProfile().DisplayName And 'User Permissions'.Value = "Admin"))

 

Seemed to work perfectly within the organization. I'm sure there could've been an alternative but this seemed to work. 

View solution in original post

Hi @mtwining1  - Glad you got it working 👍

 

Just want clarify this for anyone else reading this thread and looking for a similar solution in future.

 

The original question posed, related to looking up a separate list for users with 'admin' permissions in a separate list. The solution I gave for that scenario is a valid solution, which takes account of the person column by comparing 'personcolumn.email' (string) vs 'User().Email' (string) and checks if their permission level is "admin".

 

Just want to point this out for future solution seekers as ordinarily, there shouldn't be a requirement to implement workarounds in this case.

View solution in original post

7 REPLIES 7
AmDev
Super User
Super User

Hi @mtwining1 

 

You could try in the visiblity of the button: Lookup(YourPermissionsList, ListUser.Email = User().Email).Permission = "admin".

 

- ListUser.Email is the Email value from the ListUsers column of your permissions list

- Permission is a column in the same list with permission level

- admin is the perission level value that needs to be met

 

(might need to rap 'User().Email' in Lower(----)...but might be OK as is above)

I was getting errors relating to not being able to use the results as a boolean, because the return should be true or false. I have a screenshot of what the list has. I also thought try compare to emails so I added the email column onto the list but that did not work either.

 

User and User Permissions (must be Admin) much match the person who is logged on. If it is, the visible property of the button will be true, if not, false.

mtwining1_0-1638451002105.png

mtwining1_1-1638451510079.png

 

 

AmDev
Super User
Super User

Hi @mtwining1 - Can you send through the code you tried? Cheers

@AmDev Lookup('ECR Coordinator App AD', 'ECR Coordinator App AD'.Email = User().Email) = "admin"

AmDev
Super User
Super User

Hi @mtwining1 

 

Try adding the following:

 

Lookup('ECR Coordinator App AD', 'ECR Coordinator App AD'.Email = User().Email).'User Permissions'.Value  = "admin"

 

This grabs the value from the record you have isolated to then compare against the text "admin"

mtwining1
Helper I
Helper I

I found the issue could have been with the type of Column in the SharePoint list (People). So a workaround was I created a column as a single line text that copies the People column which was titled Username as a string, so it can compare in PowerApps Text to Text when using Lookup.

 

One button is based on the user actually being on the list.

!IsBlank(LookUp('ECR Coordinator App AD',CoName = Office365Users.MyProfile().DisplayName))

 

The other button is access to manage the list

!IsBlank(LookUp('ECR Coordinator App AD',CoName = Office365Users.MyProfile().DisplayName And 'User Permissions'.Value = "Admin"))

 

Seemed to work perfectly within the organization. I'm sure there could've been an alternative but this seemed to work. 

Hi @mtwining1  - Glad you got it working 👍

 

Just want clarify this for anyone else reading this thread and looking for a similar solution in future.

 

The original question posed, related to looking up a separate list for users with 'admin' permissions in a separate list. The solution I gave for that scenario is a valid solution, which takes account of the person column by comparing 'personcolumn.email' (string) vs 'User().Email' (string) and checks if their permission level is "admin".

 

Just want to point this out for future solution seekers as ordinarily, there shouldn't be a requirement to implement workarounds in this case.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,161)