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

Check if user exists and compare it with

Hi all,

I'm trying to display a section of a menu to users that are in a SharePoint list. In my app i have a button for testing titled "Admin", when pressed, if the user is on that SP list then the navigation will display. 

 

Can someone please point me in the right direction if no examples are available? 

 

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Check if user exists and compare it with

@_sourcecod3_ 

For example, you could create a SharePoint list called "AppAdmins", with a single Person column called 'PersonColumn'

 

PersonColumn
John Smith

 

Then in your App's OnStart property use this code to create a true/false variable.

Set(isAdmin, !IsBlank(LookUp(AppAdmins, PersonColumn.Mail=User().Email)))

 

Finally, put this code in the OnVisible property of the Admin button

isAdmin

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Super User III
Super User III

Re: Check if user exists and compare it with

Try:

If(CountRows(Filter(TableName,ColumnName = "Admin")) > 0,Notify("Exist"),Notify("Does Not Exist"))

 

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.

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Check if user exists and compare it with

@_sourcecod3_ 

For example, you could create a SharePoint list called "AppAdmins", with a single Person column called 'PersonColumn'

 

PersonColumn
John Smith

 

Then in your App's OnStart property use this code to create a true/false variable.

Set(isAdmin, !IsBlank(LookUp(AppAdmins, PersonColumn.Mail=User().Email)))

 

Finally, put this code in the OnVisible property of the Admin button

isAdmin

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Super User III
Super User III

Re: Check if user exists and compare it with

Try:

If(CountRows(Filter(TableName,ColumnName = "Admin")) > 0,Notify("Exist"),Notify("Does Not Exist"))

 

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.

View solution in original post

Highlighted
Helper III
Helper III

Re: Check if user exists and compare it with

@mdevaney  Thank you!! that worked perfectly!

Highlighted
Helper III
Helper III

Re: Check if user exists and compare it with

@eka24  Update: this solution worked better for my situation. Thanks Eka for this. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,189)