Best way to go about layering multiple filters on a repeating group?

I am currently building a repeating group that displays data from my database and wish for users to be able to apply/select multiple filters that can layer on top of each other and show the results in the group (think Amazon and their price/category/etc. filters)

My data set looks like this: Name, Price, Type, Sub-type, and Year. I have a dropdown select for the type and sub-type, but also want users to be able to specify a range for price/year. For example, a user could enter $20 in the minimum price input box and $40 in the maximum price input box and then select “Fashion” from the Type dropdown menu - this would show them all database items that have a price between 20 and 30 and have “Fashion” in the type field.

I have built a few rudimentary versions of this but the number of workflows just keep growing and growing as I have to cover different scenarios for each filter (e.g. what workflow do I need if the user only sets a max price and a type, leaving sub-type and min price alone. Or what if they have a minimum price but don’t select a type). I am currently opting to use the “when input is changed…” trigger to do some of these actions, but the more filters I add, it just keeps getting more and more complex.

What would be the best way to go about this?

Thank you!

The easy way to do this I’ve found :slight_smile: is use the “Ignore empty constraint” - this video explains it
https://bubble.io/video/how-to-use-ignore-empty-constraints

Thanks for the help! Do you have an idea of how I could implement this with the price range input boxes? I watched the video but am not completely sure how I should go about this.

This example might help. Shows how “ignore constraint when empty” is very useful :slight_smile: https://knowcode-tech.bubbleapps.io/version-test/repeating_group_filters?debug_mode=true](https://knowcode-tech.bubbleapps.io/version-test/repeating_group_filters?debug_mode=true)

and in the editor
https://bubble.io/page?type=page&name=repeating_group_filters&id=knowcode-tech&tab=tabs-1

Andrew Vernon shared this amazing way to do the same on twitter. Check it out here: https://twitter.com/Andrew_Vernon/status/1484305152727465985

This will change the way you do this.

4 Likes

Curious for thoughts on how scalable this approach would be. Looks like this is calling for data to be loaded to the page, then running it through multiple client side filters, plus a lot of on-page workflows and conditionals.

I wonder how it would work for 10,000 records, or 100,000 records?

Also what is the advantage of this approach vs. just loading the constraints into the “Do a search for box” (as @lindsay_knowcode notes). This should be more scalable because the search would be server side. Also it would be easier to set up and maintain vs. building a chain of workflows.

This topic was automatically closed after 70 days. New replies are no longer allowed.