Forum Academy Marketplace Showcase Pricing Features

Groupings within a repeating group

Is it possible to use groupings within a repeating group?

In the same way, within Airtable, Clickup, etc you can group items that share a similar field, I’m wondering how/if can do this within Bubble’s repeating groups? Or do I need to work this out using lists? I’m trying to break a list of tasks down into critical, high priority, etc and group tasks with those shared priorities together.

At the moment, I’m manually creating multiple repeating groups which means having five searches instead of one and is far from ideal!

If the “parent” RG is a Thing with a list X on it, (ie 1 search) then there is no issue having an RG in a cell of the parent RG, populated with the list X.

Every performance guide I’ve read says that having searches within searches is Bad - common sense really which you’ve already figured out :slight_smile:

You could do an order by on “priority” (and/or add a numeric field as a proxy for priority so they display in a definable order) so they display in “bunches” of priority.

So I guess this is the main issue that I’m struggle with - the parent isn’t really an RG as there is not a list of priorities. I’m still doing five searches insteam of one. It’s only really become an issue because I’m trying to use URL parameters now to do filtering, and searches are taking a lot longer. This is how I’m doing it now, with five RGs for each priority.

I know I could do one search and order them, but I like the visual grouping so it is clear what is critical, and high priority.

Even putting an RG within another RG if I create a table for priorities, still results in doing five searches (well six now for the parent RG).

So I’ve been reading the Bubble documentation, and I see that if Bubble sees the same search twice it does it once. So I imagine I will improve performance in the above by putting the same search on each item and then applying a filter to that same search?

Still can’t work out if this is possible to do dynamically

@philsim

Some ideas/comments for your consideration:

  • Create a popup that you never open and call it “hidden popup for data”; add RGs and call them “data - things1”, “data - things2”, etc. As least RGs as possible of course in order to avoid unnecessary searches (… RG vs "Search for" (performance questions) - #6 by cmarchan)
  • Populate your page RGs with the hidden popup “data things”. The reason for this is multifold but in short … your searches will be ready to go on page load as popups are always loaded on the page no matter what and you have the ability to add conditions to limit the number of items loaded.
  • Always remember that whatever you place on an RG is going to multiply by the nr of loaded items. Example: If you have a dB model where a project has a list of milestones and you have an RG searching for projects … then every project you load is going to load all of its milestones. Each one with their multiple milestones.
  • Structure your dB avoiding list fields as much as possible and rather relate things indirectly (example: project and milestone; milestone is related to the project only and the project does not have a list of milestones). If you make your objects “light” your searches will be fast.
  • Depending on how you structure your data you can do things pretty performing. Example: Project with no list of milestones and no list of tasks, Milestone with a reference to its project and no list of tasks, Task with a reference to its milestone and to its project.

For further reference to why I laid out the above please refer to this resource (paid) created by a very experienced Bubbler @petter which is full of gold nuggets, and to this other great post by @lottemint.md also full of excellent suggestions and an active and experienced contributor to this forum as well:

Hope this sparks some ideas :grinning:

1 Like

So for anyone else who is looking to do “groupings” within a data set and it’s not obvious, here’s how to do it.

What wasn’t obvious to me was that repeating grids don’t have to be “database tables”. So I had my priorities in an Option Set, so my parent repeating grids pull those option sets, and then the inner repeating groups pull the repeating group. I’m pulling the main set of data with a search, and then applying filters (both the master filter for the priority as well as additional user filters in a filter on that set).

My page had additional complexity because I had tabs, with custom filters on it and I’ve now moved from 20 database searches to 1! Leveling up :slight_smile:

1 Like