cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kmayes
Post Prodigy
Post Prodigy

Multiple Filter Issue

Hi 

 

I have an application where I have one search box and two combo boxes and beneath is a gallery showing the data from a collection.

 

Previously i have just a search box to filter the gallery however I now need to implement the filter with the combo boxes. I have this working when you select the exact data however I would like it to show all data until the selection is made, I hope that makes sense?

 

Let me know if you can support on this issue 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

HI @Kmayes ,

You might share some code here, but the structure would be

Filter(
   ListName,
   (
      IsBlank(ControlOutput1) ||
      FieldName1 = ControlOutput1
   ) && 
   (
      IsBlank(ControlOutput2) ||
      FieldName2 = ControlOutput2
   ) 
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

HI @Kmayes ,

You might share some code here, but the structure would be

Filter(
   ListName,
   (
      IsBlank(ControlOutput1) ||
      FieldName1 = ControlOutput1
   ) && 
   (
      IsBlank(ControlOutput2) ||
      FieldName2 = ControlOutput2
   ) 
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz Apologies the code I currently have is 

SortByColumns(Filter(LIST,Date=Blank() || Date=Today() , StartsWith(Postcode,TextSearchBox1_2.Text) , StartsWith('Coverage Area',COMBOBOX1.Selected.Value) , StartsWith(Workstream,COMBOX2.Selected.Value ))

, "Address_1",Ascending,"Address_2",Ascending)

 

Hi @Kmayes ,

Something like this structure should do it

SortByColumns(
   Filter(
      LIST,
      (
         Date = Blank() || 
         Date = Today() 
      ) &&
      (
         Len(TextSearchBox1_2.Text) = 0 ||
         StartsWith(
            Postcode,
            TextSearchBox1_2.Text
         )
      ) &&
      (
         Len(COMBOBOX1.Selected.Value) = 0 ||
         'Coverage Area' = COMBOBOX1.Selected.Value
      ) &&
      (
         Len(COMBOBOX2.Selected.Value) = 0 ||
         Workstream = COMBOX2.Selected.Value
      )
   ), 
   "Address_1",
   Ascending,
   "Address_2",
   Ascending
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,071)