Forum Academy Marketplace Showcase Pricing Features

The best way to filter with multiple checkbox

Hello all,
I have been trying for some days now to implement a filter on RG, but it seems to be a lot of trouble archiving my goal.
I have 15 fields that will be used to filter records on the RG, and most of these fields type are yes or no.
For example, let say the fields are: hasTwitter, hasGoogleAnalytic, facebookPixel, etc. when a user select hasTwitter and the others are not selected, it should show all result that hasTwitter is yes, and when it is deselected, it should show all record without considering if it yes or no.

The problem is that with yes and no field type, ignore empty constraints does not work on when the filter value is no.
Another concern, if you have to use condition to change the data source of the repeating group and do merging based on which filter was selected, this becomes an issue when dealing with a lot of filter options.
I will appreciate any suggestion on how best to solve this problem.

1 Like

Hey @Famous ,

I usually like to “daisy chain” searches with potentially lots of filters in the workflows. Essentially, you set up a custom event for each filter. Each event triggers the next filter and it doesn’t matter what order they’re in. You can trigger the chain from a single button click to allow the user to make their selections first or you can trigger the moment they interact with any input (like a checkbox) that would change their results.

Let’s say these are your workflow events:

  • When checkbox’s value is changed > trigger event 1
  • Event 1: display list in RG with Search of Records where hasTwitter = yes // only when the checkbox for hasTwitter is checked > trigger event 2
  • Event 2: display list in RG with RG’s list :filtered (hasGoogleAnalytics = yes) // only when the checkbox for hasGoogle Analytics is checked > trigger event 3
  • Event 3: display list in RG with RG’s list :filtered (hasFBpixel = yes) // only when the checkbox for FBpixel is checked > trigger event 4
  • And so on…

So, the first event does the first proper search with your first filter. The next event filters on that result, the event after that filters on the previous result, and so on.

One of the biggest keys here is that the actions to “display list” only happens if the checkbox for that filter is checked. If the user left it unchecked, the condition fails which will skip that filter and just move on to the next event. That way, it doesn’t matter what value the records have for that filter.

Remember, if you’re going to trigger the chain from the checkboxes so that results update immediately, you have to set up that trigger for all checkboxes. In other words, all checkboxes trigger event 1.

There’s lots of adjustments you can make to this depending on what else you have going on , but start with one filter at a time, test it, and add on layer by later.

Hope this helps!

–
Cheers, Gaby
Co-Founder at Coaching No Code Apps
Free Bubble Masterclass
Private Help

1 Like

Thank very much Gaby. I will definitely put this into practice tomorrow.

1 Like

The way I achieve this kind of search is the following :

Each searchable field has a state on the page, yes/no type or the type you need.

In the RG’s do a search, each constraint is based on those states, and “ignore empty constraints” is checked, so if a record has a yes/no field empty, this not block the search.

You can also preset the search by setting states on page load.

Hope this helps.