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

Filtering a gallery by different fields

I'm trying to make an app that is connected to a Google sheet now as Sharepoint online couldn't do as much and I can get each of these filters to work indepentently, but can I somehow combine them all into 1?

 

The first 2 filters are by dropdowns and the third is obviously a search.  I would like it so that all 3 can be used simultaneously.  So you can select a building, a tech, and still be able to search if you wanted.

 

If(!IsBlank(FiltBuilding.Selected.Value),Filter(Powerapp,Building=BuildingVar.Value),Powerapp)
If(!IsBlank(FiltTech.Selected.Value),Filter(Powerapp,Tech=TechVar.Value),Powerapp)
If(!IsBlank(Search1V),Filter(Powerapp,Search1V in Desciption || Search1V in Destiny),Powerapp)

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff AKotb
Power Apps Staff

Re: Filtering a gallery by different fields

You Can try to set the Items Property to

Filter(Powerapp, 
If(IsBlank(FitBuilding.Selected.Value), true, Building=BuildingVar.Value),
If(IsBlank(FiltTech.Selected.Value), true, Tech=TechVar.Value)
If(IsBlank(Search1V), true, Search1V in Desciption || Search1V in Destiny)
)

so each filter argument will be applied if it is applicable, otherwise it will return true so it doesn't affect other conditions.

Since filter conditions are combined with an And Operator.

View solution in original post

2 REPLIES 2
Power Apps Staff AKotb
Power Apps Staff

Re: Filtering a gallery by different fields

You Can try to set the Items Property to

Filter(Powerapp, 
If(IsBlank(FitBuilding.Selected.Value), true, Building=BuildingVar.Value),
If(IsBlank(FiltTech.Selected.Value), true, Tech=TechVar.Value)
If(IsBlank(Search1V), true, Search1V in Desciption || Search1V in Destiny)
)

so each filter argument will be applied if it is applicable, otherwise it will return true so it doesn't affect other conditions.

Since filter conditions are combined with an And Operator.

View solution in original post

Tech08
Level: Powered On

Re: Filtering a gallery by different fields

Filter(Powerapp, If(IsBlank(FiltBuilding.Selected.Value), true, Building=BuildingVar.Value), If(IsBlank(FiltTech.Selected.Value), true, Tech=TechVar.Value), If(IsBlank(Search1), true, Search1.Text in Desciption || Search1.Text in Destiny))

 

There were a couple typos I had to catch and I had modified the search since I had posted, but after fixing those it works like a charm.

 

Thanks!

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,937)