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 / Filter a Powerapps Gal...
Power Apps
Answered

Filter a Powerapps Gallery by Person or Group Column

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello! 

 

I am filtering a gallery by a Sharepoint list

 

The list is data from a form

I just need to filter the gallery so only users see their own records. However the field that contains their name is a "Person Or Group" field and I am unsure on how to filter a gallery by this. 

 

What I normally would do if it was text would be:

 

 

Filter(Datasource,User().FullName=NameColumn)

 

Any help would be appreciated!

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Your formula would be like this:

    Filter(Datasource, NameColumn.Email = User().Email)

     

    Sometimes the User function in the filter causes erroneous results, so consider also putting it outside the filter:

    With({_usr:User()},
     Filter(Datasource, NameColumn.Email = _usr.Email)
    )

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey Randy, Running into an issue on this one. The following function works perfect for me and as intended. It works for a lot of other people too. However for other people in the organization they cant see any records in the gallery. Here is the code:

    If(
     Filter_Query.Selected.Value = "1.) Request's I have Approved",
     With(
     {_usr: User()},
     Filter(
     'datasource',
     Manager.Email = _usr.Email && Status = "Approved"
     )
     ),
     If(
     Filter_Query.Selected.Value = "2.) Request's I have Created For Others",
     With(
     {_usr: User()},
     Filter(
     'Odatasource',
     'Created By'.Email = _usr.Email && Not(Traveler.Email = _usr.Email)
     )
     ),
     If(
     Filter_Query.Selected.Value = "3.) Request's I've Made For Myself",
     With(
     {_usr: User()},
     Filter(
     'datasource',
     'Created By'.Email = _usr.Email && Traveler.Email = _usr.Email
     )
     ),
     If(
     Filter_Query.Selected.Value = "4.) All Of The Above",
     With(
     {_usr: User()},
     Filter(
     'datasource',
     'Created By'.Email = _usr.Email Or Traveler.Email = _usr.Email Or Manager.Email = _usr.Email
     )
     )
     )
     )
     )
    )

     

    All of the users are in the same tenant but have different endings to email addresses. Is there something off the top of your head that could be causing this? 

     

    All of the users also have the same permissions in the Sharepoint list.

     

    Like I said, this works perfectly for me but for some end users this code is not working.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    I would first clean up the formula on this.

    With({_usr: User(), _src: Left(Filter_Query.Selected.Value, 1)},
     Filter('datasource',
     Switch(_src,
     "1", Manager.Email = _usr.Email && Status = "Approved",
     "2", 'Created By'.Email = _usr.Email && !(Traveler.Email = _usr.Email),
     "3", 'Created By'.Email = _usr.Email && Traveler.Email = _usr.Email,
     "4"", 'Created By'.Email = _usr.Email || Traveler.Email = _usr.Email || Manager.Email = _usr.Email
     )
     )
    )

     

    The next question I would have would be related to delegation.  How many records are in your list and what is your record limit set to?  

    It is possible that those not getting results might be outside of the record limit.

    Now...the above formula is not delegable, but your original was not either.  So if record limit is the issue then the above needs some changes to be delegable.

  • Bethany123 Profile Picture
    12 on at

    Hey,

    I'm having the same issue and wondering if you ever found a solution?

    Thanks

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard