cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Filtering a gallery by user's location

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

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.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Super User
Super User

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.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

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))))

 

 

 

 

 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,521)