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

Show/Hide Button based on Current User Matching person Type-Column in a Gallery

Show/Hide Button based on Current User Matching person Type-Column in a Gallery


Is it possible to make a button that is placed in a gallery only to be visible for the current user if the user Matches the person/ Group Type-Column in the SharePoint list?

 

In my Power App, I need a button in my gallery to only be visible if the logged-in user is set to be the "Approver" in a people or Group Type-Column in SharePoint. So this variable will vary based on who is responsible for each record.

 

I have tried these formulas in the On Visible property, with no luck:

 

Filter(SPList;Lower(ThisItem.Approver.DisplayName)=Lower(User).FullName))

 

 

Filter(SPList;Lower('Approver'.DisplayName)=Lower(User().FullName))

 

 

If(User().Email in searchApprover_1.SelectedItems.Email

 

 

CountRows(Filter(SPList,User().Email in Approver.Email ))

 


Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

I would personally use the email address.  It has to be absolutely unique whereas Names don't.

 

So if you are using the built in person field then your formula should look something like this:

 

If(
  User().Email in ThisItem.Approver.Email,
   true,
   false
)

 



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

View solution in original post

2 REPLIES 2
JR-BejeweledOne
Super User
Super User

I would personally use the email address.  It has to be absolutely unique whereas Names don't.

 

So if you are using the built in person field then your formula should look something like this:

 

If(
  User().Email in ThisItem.Approver.Email,
   true,
   false
)

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Linn93
Helper I
Helper I

It worked! Thanks so much for your help @JR-BejeweledOne

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.

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 (5,320)