Large and Complex Filter - Simplify Advanced Filters

Hey Everybody! :wave:

I have a very complicated search and sort function that filters through a bunch of data to produce a repeating group. I have it working but it is so convoluted that it takes forever to load and would like to simplify it.

This is currently how I filter the repeating group based on each of the criteria:

Each filter is required to produce the right RP. I have spent months widdling it down to this and can’t simplify it any further.

I don’t have API experience so wouldn’t know how to offload that to an API function, does anyone have an idea on how I could simplify that mess?

Thanks in advance!

Some thoughts… the top four constraints will need to stay as advanced filters since they use “intersect with”. As you probably know, this means Bubble has to keep downloading records to the page until the advanced filter (which is run client side, on the page) finds enough results to fill the RG. Therefore the goal should be to minimize the amount of data Bubble needs to send to the page. Suggestions…

  • The bottom two constraints don’t look like they need to be an advanced filter. Move them to the regular “do a search for” box and they’ll run server side. Not only is this faster, but it shrinks the size of the data set sent to the page for the advanced filters to go through.
  • Format your RG group to minimize the number of results that need to be shown right away. For example, use a scrolling RG so that Bubble is only needing to load what it needs to fill the cells shown.
  • Use privacy rules to prevent any unneeded fields from being downloaded to the page. This won’t impact the # of records being downloaded, but it will shrink the size of each record.

Also, if any of your advanced filters, which are list-to-list searches, could be replaced by item-to-list searches (where the user is selecting one item to search on instead of many), then you can move them out of advanced filters as noted above.

There is a way to run an advanced filter server side via an API, basically having Bubble treat itself like an external database it is calling data from. It’s a lot more complex to set up.

1 Like

@ed727 Good catch on the last two constraints! I switched those out and that helped the page performance and speed. Using a scrolling RG which helps too.

I think I’ll have to eventually move this out to API, but in the meantime, that helped a bit, thanks!

Awesome… my hope is that one day Bubble moves the “intersect with” function server side, since a list-to-list search is fairly common.