Help with filtering logic on a RG

I am trying to filter out a data from a RG but I am having trouble with the filtering expression.

I’m a huge fan of the daisy chain filtering:

I’m not even sure @Andrew.Vernon likes it as much as I do. I mean, he’s too busy being senior engineer nowadays. :sweat_smile:

1 Like

Hey @sheepherd.co :waving_hand:

I love the “Chain filtering” as well.
But in you case, you can do it using Option Sets as well.
Another solution from the above will be this…

Editor here

Obviously, we’ll have to arm wrestle for it @rico.trevisan

Yea, daisy chains can be super useful! At times, I also really like using hidden variables to store the constraints and conditionally make them empty when a filter shouldn’t be applied. Doing that, you can reference them directly in the RGs datasource. There are pros / cons to both approaches!

Great to hear from you Rico!

1 Like

@rico.trevisan @rpetribu Yall two are lifesavers! Thank you!

2 Likes

Hey @sheepherd.co

I would approach it like this:

  1. Set up an Option Set for “Tabs” (Overview, Income, Budget, Transactions, Goals, Suggestions)
  2. Set up another Option Set for “Cards” (Monthly Income, Received, Left to Budget, Total Spent, Remaining)
  3. On the “Tabs” Option Set, create an attribute “Cards To Show” of data type “List of Cards”.
  4. Set the four cards you want to show for each Tab item in this list on the Option Set (for example, Tab “Budget” has the list of Cards “Monthly Income”, “Left to Budget”, “Received”, “Total Spent” held here)
  5. When you click on the Tab, this is passed to the URL (as you’ve done) but use the Option Set’s full name, not just the letter.
  6. Your Repeating Group at the top (Cards) should be Data Type “Cards”
  7. Your Repeating Group of Cards should have Data Source: Get Tab from URL (data type: Tab)'s Cards to Show.

No filtering needed.

@sheepherd.co you’ve got some good ideas so far. I personally have never used daisy chain filtering as I’ve yet to come across a use case where I find it better than just using constraints on the search. My preference is to use one option set. Below is a video demonstration of how to set it up and explanations as to why it is my preferred approach.

BTW, the type of app you are building in production will be a huge consumer of WUs because of the daily data creations, regular fetching of large amounts of data etc. If you are interested in learning some techniques to reduce the WU costs, improve performance (faster/snappier app), and build faster, feel free to reach out in a PM as I can help you ensure this app can scale it’s user base on Bubble

1 Like