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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Display Button if Logg...
Power Apps
Suggested Answer

Display Button if Logged in User exists in a Sharepoint List

(0) ShareShare
ReportReport
Posted on by 45
Hi,
 
I have a Canvas App.
 
I have a sharepoint list 
"My Line Managers List"
 
and a Text Column in that list:
"Service Line Managers Email"
 
(The sharepoint list just stores a list of Emails. There is no fixed number of them. Emails will be added as and when new people are assigned.)
 
On App Start i assign a Global Variable:
"varLoggedInUserEmail, User().Email"
 
I have 2 buttons on screen:
 
Button1 which is always Visible no matter who is logged in
 
Button 2 is only Visible if the following condition is met:
 
Search through the Sharepoint List "My Line Managers List", "Service Line Managers Email" column to see it the varLoggedInUserEmail exists in the list.
 
If it does i want Button 2 to be visible, if the varLoggedInUserEmail does not exist in the Sharepoint Ljst then i want Button 2 to be hidden.
 
Please can anyone suggest the fx i would need to use in the Visible property of Button 2 to achieve this functionality.
Or suggest a better way to do it.
 
Categories:
I have the same question (0)
  • Suggested answer
    Vish WR Profile Picture
    1,731 on at
    Hi Good Day 
     
    You can try this. I have tested with a sample list. If the email is not in the list, the button won't appear 


    App start 
    Set(varLoggedInUserEmail, User().Email)
     
    Button Visible (Replace the ManagerEmail with ur columnname in the list )
    !IsBlank(
    LookUp(
    SampleTest,
    Lower(Trim(ManagerEmail)) = Lower(Trim(varLoggedInUserEmail))
    )
    )

    When the email matching button is visible 
     
     
    When the email does not match, the button will not be visible 

     
    Note: You need to create the datasource for the SPO list 
     
     
     
      Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 
     
     
     
  • CU10041356-0 Profile Picture
    45 on at
     
    Hi,
     
    Thank you!
     
    I managed to get the error sorted but is there a fix for the Delegation Issue - the list will have over thousands of items eventually.
     
    So with the Delegation issue the solution wouldn't work!
     
  • Suggested answer
    Kalathiya Profile Picture
    1,962 Super User 2026 Season 1 on at
     
    You are getting a delegation warning due to that you are using the Lower and Trim function are non-delegable functions, so could you please try below code and check:
     
    Set(g_IsAdmin,
    CountRows(
        Filter(
            'YourSharePointList',
            'ManagersEmail' = User().Email
        )
    ) > 0);
    
    //YourSharePointList - Replace with your SharePoint List
    //ManagersEmail - Replace with your column setup
    
    //It will return true/false value
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------

    📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.

    ✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.

    💛 A Like always motivates me to keep contributing!

    ​​​​​​​
  • CU10041356-0 Profile Picture
    45 on at
    @Kalathiya
     
    Many thanks for responding.
     
    I am not sure what the Set(g_IsAdmin, is doing though.
     
    But i put the code into the Visible Property (using my own List and Column names but i get an error.
     
     
    Behaviour functionin a non-behaviour property. You can't use this property to change values elsewhere in the app.
    Delegation warning. The highlighted part of this formula might not work correctly on large data sets. The "CountRows" operation is not supported by this connector.
     
    Thanks again!
     
  • Ram Prakash Duraisamy Profile Picture
    5,753 Super User 2026 Season 1 on at
     
    In Visible Property of Button use below code
     
    !IsBlank(
        LookUp(
            LIST NAME,
            Email = User().Email
        )
    )
     
    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991
  • Kalathiya Profile Picture
    1,962 Super User 2026 Season 1 on at
    Hello @CU10041356-0
     
    Sorry for uncleared details.
     
    As a best practice, declare this variable in the App OnStart property so it gets initialized once when the app loads and doesn’t need to be set repeatedly.
     
    App OnStart Property:
    Set(g_IsAdmin,
    CountRows(
        Filter(
            'YourSharePointList',
            'ManagersEmail' = User().Email
        )
    ) > 0);
    
    //YourSharePointList - Replace with your SharePoint List
    //ManagersEmail - Replace with your column setup
    
    //It will return true/false value
     
     
     
    and use g_IsAdmin variable for button visibility. 
     
    Button - OnVisible: 
     
     
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
     
     
     
     
     
     
  • CU10041356-0 Profile Picture
    45 on at
    @Kalathiya
     
    Many thanks!
     
    I added fx code as suggested and the Button does hide now.
    But i still get the Delegation issue . So as this will be a large list - i need to avoid Delegation issues.
     
    I get the warning:
     
    Delegation Warning. The highlighted part of this formula might not work correctly on large data sets.
    The "CountRows"operation is not supported by this connector.
     
    The highlighted text is :
     
    CountRows(Filter('YourSharepoint List','ManagersEmail' = User().Email))
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard