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 / Hiding data cards base...
Power Apps
Unanswered

Hiding data cards based on “person or group” field

(0) ShareShare
ReportReport
Posted on by 68
Hello,

I am looking to hide a data card if the login user in SharePoint is the same as listed on a “person or group” field from the SharePoint list.

Ex: field with type person/group contains the manager name, so only if this manager open the form he can see that DataCard.

Thanks!
Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    @EMohaisen 

    Assume your sharepoint list is called "SPList" and the person or group field is called "Approvers" then you could use the below code to check if current logged in User is part of that list

     

    Use CountRows(Filter(SPList,User().Email in Approvers.Email )) and check to see if the row count is greater than 0. If yes then show the data card else hide it

     

    Hope this helps

  • EdMoh Profile Picture
    68 on at

    Hello @RezaDorrani ,

     

    Thanks for the information, actually the "person/group" field is in the same SharePoint list, and this SharePoint list contains other fields that i would like to hide if the login user is the same as in the "person\group" field.

     

    ex: i have attached a screenshot of a list that contians the field that i would like to hide and the person\group field.

     

    Thanks!

     

    2019-04-13_23-57-43.jpg
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @EMohaisen ,

     

    Try If(User().Email in DataCardValue6.SelectedItems.Email,true,false) as the Visible condition for your data cards you want to hide

     

    DataCardValue6 is the name of the people picker field data card value on the PowerApps EditForm

     

    Hope this helps

  • EdMoh Profile Picture
    68 on at

    Hello @RezaDorrani 

     

    Thanks for the info, but unfortunately it's still not working for me.. (please see attached screenshot3)

     

    I created some labels and tried to get the actual values for both User().Email and "DataCardValue6.SelectedItems.Email" to see if they are equal, it didn't work for "DataCardValue6.SelectedItems.Email", please see attached screenshot4, i assume it should return the email address as text, correct ?

     

    Thanks again for your help!

     

    Reg

    Eyad

    Screenshot3.jpg
    Screenshot4.jpg
  • RezaDorrani Profile Picture
    12,145 on at

    @EMohaisen screenshot4  SelectedItems.Email - you cannot assign it to a label field because you return type will be a collection of records

     

    Try associating it with a gallery just to check the values

     

    Gallery Items property would be your datacardvalue.selecteditems

    and then put a label inside that gallery and apply thisitem.Email to it to see the values

     

    Also, based on screenshot 3 it looks like you are using the New Item form , which would have your people picker column empty, so the check User.Email() in datacardvalue.selecteditems.Email would return false

     

  • apirez Profile Picture
    on at

    Hi Reza,

    I have a similar, but different issue. Im looking to show a card if the user() is equal to the email text in a field. What am I missing here. Im in a huge bind. Thanks! 

    email.png

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard