Filter Repeating Group with Repeating Group

Hi All,

I have been browsing the forums for days and have been trying to filter a repeating group using another repeating group. Essentially, I am trying to create a website similar to https://www.keyvalues.com

Posts by @fayewatson , @rico.trevisan , and @mattb have been useful, but I’m still stuck. Anyone have any guidance on how to carry this out? Please see my set up below.

Goal : Filter a list of companies (RG iBanks) by any of the selected ethical values in a list of ethical values (RG Values). Thus, companies that have any of the selected ethical values will be displayed (show companies that have selected value 1 OR selected value 2 OR selected value 3…etc).

Data & Data Structure - Pulling data via Airtable API
“Vibe Values” is a data type that has ethical value name (text), category of ethics (text), and a list of iBanks (list)

“iBanks” is a data type that has company name (text) and a list of Vibe Values (list)

App Set Up

  • I am adding selected ethical value from RG Values to a custom state list (called “Selected Values”). I think using custom states is the easiest way (but correct me if I’m wrong) to filter RG iBanks. The custom state is set up on the page Index

RG iBanks has two conditionals: (1) if custom state list Selected Values is empty, show all the data without a filter; and (2) if custom state list Selected Values is not empty (did I lay this out correctly?), … this is where i need help.

What’s the best way to proceed with the filter?

I’ve never used Airtable, but I believe that the standard principles of filtering an RG based on multiple entries in another item will apply.

I don’t think you need conditionals here at all.
Just have a single data source which is your Airtable iBanks and make sure to have “ignore empty constraints” checked. This will essentially perform the same function as your 2 conditonals, just a lot more efficiently.
Then in your datasource add a constraint using intersect with where count > 0. There are a number of posts on the forum that explain how to set this up.

Thanks SerPounce, but I have tried this already (found here) with no luck. Whenever I preview the page, RG iBanks doesn’t load onto the page. I am able to confirm that the selected values are being added to Custom State Selected Values through conditional formatting on RG Values.

Are there other possible solutions for this? When I was thinking through this feature, I thought it would be relatively simple to implement, but the past few days have taught me otherwise.

Since you’re using Airtable, couldn’t you do the filtering on Airtable? That API call - I’m assuming - can include filters and search terms. It will also make your client snappy since the heavy lifting is happening on the database instead of the client side.

Hi Rico - Good suggestion! I looked into it and it seems that the the Airtable API is only for pulling data from and writing data to Airtable (essentially replacing the native Bubble database).

But that gave me another idea just to try the native Bubble database, and the “intersect with” function works perfectly! Looks like the Airtable API has several bugs (such as certiain filter functions and removing Airtable things from a custom state list).

Thank you Rico and thank you @SerPounce for the help!

2 Likes

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