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 / Filtering a gallery by...
Power Apps
Answered

Filtering a gallery by user's location

(0) ShareShare
ReportReport
Posted on by 52

I'm creating a visitor register app, the data source is a SP list.

I'm capturing the office with a person column, the display field is "office"

On the app I have an admin page, where I need to filter the visitors gallery  based on the office of the admin that is logged in.

The idea is that the admin can mass "Check Out" visitor for their own office.

 

When I select the office field in powerapps, there is no option to select office, it shows display name, email, claims , department and image but there is no office.

 

I've tried adding the O65 connector and I managed to get the office location of the logged in user, but have not been able to come up with the filter gallery sintax.

 

This is the filter expression I have working so far, I need to add the office portion. I've tried like hundred different expressions and I don't get the expected results

 

If(Dropdown2.Selected.Value = "All",Filter(VisitorRegister, Created>=Today()-2),
Dropdown2.Selected.Value = "Open",Filter(VisitorRegister, Created>=Today()-2 && IsBlank(CheckOut)),
Dropdown2.Selected.Value = "Closed",Filter(VisitorRegister, Created>=Today()-2 && !IsBlank(CheckOut)))

 

I would appreciate if some one can help me.

Thank you

 

Categories:
  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    The issue is that the SharePoint people/group column doesn't store the Office location. The "show field" property of the people/group column in the SP list allows you display different attributes about the user in the list view but the majority of those aren't stored as field data. You might want to think about adding a separate office location field to your form that is a text field in the SP list and you can auto populate it with an O365User call in the PowerApps form when the visitor registers. Once you have the data in a text field you will be able to filter with out any issues.

  • omelo Profile Picture
    52 on at

    Genius!!! Thank you very much for your answer!!

    I'm almost there.

     

    How can I put this expressions together ?

     

    Filter(VisitorRegister, Office=Office365Users.MyProfile().OfficeLocation)

     

    and

     

    If(Dropdown2.Selected.Value = "All",Filter(VisitorRegister, Created>=Today()-1),
    Dropdown2.Selected.Value = "Open",Filter(VisitorRegister, Created>=Today()-1 && IsBlank(CheckOut)),
    Dropdown2.Selected.Value = "Closed",Filter(VisitorRegister, Created>=Today()-1 && !IsBlank(CheckOut))))

     

     

     

     

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard