cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Doing a Filter using multiple inputs, but need it to be so one of the inputs is blank you don't filter on a certain field

Hello. I'm trying to build a search function, and here are the input fields. The only ones that matter in this issue I'm facing now are Seat ID, Audit ID, Build Event and Incomplete Audits Only (boolean).

mycriteria.png

 

What I'm trying to do is set up a filter so it only does filters on these input fields that have value. For example, if Seat ID and Audit ID are the only ones with value then I want to do a filter using only them. So if somebody only has Build Event filled out, then I only want to apply a filter on that field and forget the rest. So essentially, filter this entity where build event is equal to what was put into the build event combo box. All the other fields are not filtered on.

 

This was my attempt. I tried to store my entity in a variable and then filter than variable in sequence depending on which input fields had value.

 

myattempt.png

 

 The issue with this was my lookup fields would not longer work or display in the gallery I'm going to be applying this filter to so I decided I couldn't use a variable.

 

Does anyone know a way to set this up so I don't have to essentially create a ton of if statements? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Doing a Filter using multiple inputs, but need it to be so one of the inputs is blank you don't filter on a certain field

Just verified this thread has a duplicate.

 

Will post the answer for the other thread here: https://powerusers.microsoft.com/t5/Building-Power-Apps/Doing-a-Filter-using-multiple-inputs-but-nee...

View solution in original post

2 REPLIES 2
Highlighted
Microsoft
Microsoft

Re: Doing a Filter using multiple inputs, but need it to be so one of the inputs is blank you don't filter on a certain field

Hi @Mgodby,

 

You could try and use the filter function with Boolean logical function such as described here: https://docs.microsoft.com/pt-pt/powerapps/maker/canvas-apps/functions/operators

 

 

An example of this can also be found in the Filter function documentation which uses the following formula:

 

Filter( Customers, SearchInput.Text in Name || SearchInput.Text in Company )

 

The result of this function is that it filters the Customers data source for records in which either the Name column or the Company column contains the search string anywhere in the given columns.

 

 

Hope this helps you in any way!

 

Regards,

Ricardo

Highlighted
Microsoft
Microsoft

Re: Doing a Filter using multiple inputs, but need it to be so one of the inputs is blank you don't filter on a certain field

Just verified this thread has a duplicate.

 

Will post the answer for the other thread here: https://powerusers.microsoft.com/t5/Building-Power-Apps/Doing-a-Filter-using-multiple-inputs-but-nee...

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,971)