web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Can you lock a screen ...
Power Apps
Unanswered

Can you lock a screen based on a people column in sharepoint?

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

Might be a strange question, but I have a training app that allows users to scroll through various company training events and register.

 

I have created a second screen for the event leaders to access in order to manage attendances, etc. 

 

I want to lock this second screen so that only approved event leaders can access. The question is, I want to create this app so that it is easily maintained by people that don't have to look at permissions or have a background in technology (I also want to hand this off and not be responsible for maintenance).

 

With that, is there a way to potentially add a sharepoint list with a set of names that I can the have the app search and and if that user is logged into the app, allow access to the second screen?

(the site is locked down to an admin person, and while they are okay with SharePoint permissions, they won't want to touch the app).

 

If so, how would I go about this from a formula perspective?

 

Many thanks in advance,

 

DW

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @DGWolfe ,

     

    It is a very common requirement.

     

    Suppose for example you have a Button control and on the selection of that Button, the user is navigated to the second screen. However, you want that Button to be visible only if the logged in user exists in your "Admin List".

     

    To achieve that, apply the below the Visible property of your Button:

     

    !IsBlank(
     LookUp(
     'Your Admin List',
     'Your People Field'.Email = User().Email
     )
    )

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

  • SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at

    Hi @DGWolfe 

     

    You can hide or disable the button if the User().Email is not in the Sharepoint List. 

     

    Button.Visible

     

    If(CountRows(Search( <SharePointList>, User().Email, <FieldName>))>0, true, false)

     

     

    Button.DisplayMode

     

    If(CountRows(Search( <SharePointList>, User().Email, <FieldName>))>0, DisplayMode.Edit, DisplayMode.Disabled)

     

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @SpongYe @DGWolfe careful with in, it is not a delegable function with SharePoint.

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

  • SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at

    @Amik 

     

    I can agree with that. I changed it to the function Search().

    It's a more reliable. Thanks for the headsup 🙂 

     

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @SpongYe careful with Search and CountRows as well, neither are delegable functions with SharePoint.

     

    Amik_0-1693528079900.png

     

    https://learn.microsoft.com/en-us/connectors/sharepointonline/#power-apps-delegable-functions-and-operations-for-sharepoint

     

    Also, regarding the below:

     

    If(CountRows(Search( <SharePointList>, User().Email, <FieldName>))>0, true, false)

     

     

    There is no need to run an IF function on a property which will only accept a Boolean anyway. You can shorten it down to:

     

    CountRows(Search( <SharePointList>, User().Email, <FieldName>))>0

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

    Imran-Ami Khan

     

  • DGWolfe Profile Picture
    on at

    Perfect! Thank you so much! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard