Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Trying to set Visible based on User().Email and SharePoint list comparison.

Like (0) ShareShare
ReportReport
Posted on 31 Jul 2022 20:48:26 by 34

Good day.

I am new to PowerApps and would like some assistance.

 

I am trying to set the visibility of a container with the following:

 

 

 

 

If(ListName.Email = User().Email, false, true)

 

 

 

Where 'ListName' =  the name of my SharePoint list with simple text emails.

 

But this does not work.

 

Any assistance would be appreciated. Thanks

  • StefanV Profile Picture
    34 on 02 Aug 2022 at 09:39:28
    Re: Trying to set Visible based on User().Email and SharePoint list comparison.

    Thank you @BCBuizer! That works perfectly...

     

    I was still not able to compare the two tables in the original question, but this now solves my problem, thank you!

  • Verified answer
    BCBuizer Profile Picture
    22,060 Super User 2025 Season 1 on 02 Aug 2022 at 09:28:00
    Re: Trying to set Visible based on User().Email and SharePoint list comparison.

    Hi @StefanV ,

     

    Can you please share what is not working for you on the original topic?

     

    On the new question, there's two things:

    1. Is UserEmail a record or a text? From your decription it looks like text, only containing the email address so the '.Value' should be dropped.

    2. Users.Email is a table indeed, so it can't be compared against a text or record using the '=' operator. Rather the 'in' should be used:

     

    If(UserEmail in Users.Email, FormMode.View, FormMode.New)

     

  • StefanV Profile Picture
    34 on 01 Aug 2022 at 16:38:52
    Re: Trying to set Visible based on User().Email and SharePoint list comparison.

    Thanks for your response @BCBuizer, but I was still not able to get it to work.

    In the meantime I have created to collections, one with my User().Email and another from a list of Emails in SharePoint. Now i am trying to compare the two and if the User().Email is found in the other collection, I want to change the FormMode of a form.

    If(UserEmail.Value = Users.Email, FormMode.View, FormMode.New)

     

    Where UserEmail = email from the the logged in user and

    User = Collection from Sharepoint list with email addresses

    Now I cannot compare the  two, even though they are both tables?

    Please could you assist wit this?

  • BCBuizer Profile Picture
    22,060 Super User 2025 Season 1 on 31 Jul 2022 at 21:08:55
    Re: Trying to set Visible based on User().Email and SharePoint list comparison.

    Hi @StefanV ,

     

    Nearly there, try:

     

    !Blank(LookUp(ListName, Email = User.Email))

     

    You can leave out the If statement since the condition itself already returns a boolean.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 20

#2
BCBuizer Profile Picture

BCBuizer 10 Super User 2025 Season 1

#2
LC-26081402-0 Profile Picture

LC-26081402-0 10

Overall leaderboard