cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
_sourcecod3_
Helper IV
Helper IV

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

@_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

eka24
Super User III
Super User III

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

@_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

eka24
Super User III
Super User III

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

@mdevaney  Thank you!! that worked perfectly!

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,122)