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
Super User

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
Super User

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
Super User

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
Super User

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,718)