cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
omelo
Level: Powered On

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

Re: Filtering a gallery by user's location

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

Re: Filtering a gallery by user's location

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

omelo
Level: Powered On

Re: Filtering a gallery by user's location

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,627)