Repeating group containing both items and sub groups


In my app, I have groups containing items, and also containing subgroups (containing other items and maybe other subgroups).
I keep track of the order of items and subgroups within groups with an order field.

Items are related to their group through a “parent group” field, of type group.
Groups which are sub groups also have a parent field, type group.

As far as I know, Bubble only allows to list one type of thing in a repeating group : ie, either items or groups. I can display all items of a group, or all subgroups of a group.

How can I display both groups and items belonging to the same group, respecting their order ?

Many thanks in advance,

Repeating group within a repeating group?

Thanks for your reply
That would work if I had only subgroups within groups.
But I have subgroups and items…

I think I found a solution - by structuring my data differently and using a unified item type within groups.

OK the solution I was hoping for is not working right now.

So here is a picture to illustrate the data layout I am trying to make :

Screen Shot 2020-05-27 at 22.27.25

Groups can contain both items and subgroups. Subgroups can contain both items and subgroups.

Groups and subgroups will be collapsible.
Groups and items would be draggable for easy reorder.

As repeating groups only work with a single type of data, I am a bit stuck.
I tried creating a single data type containing both items and groups with is_group field, but this prevents from grouping items within subgroups (unless there is a way to do this).

Thanks in advance

Thanks for the headache :slight_smile: To be honest I’m having a hard time figuring out what you’re trying to do. Maybe share your editor in view mode if you’re comfortable doing that or include screenshots

That’s not necessarily true btw

I would tackle this differently and just work with the one data type.

Fundamentally it is a RG of items within an RG of items.

I would add 2 more field to Items, to allow an item to also be a parent ‘group’ item, or child item, instead of just a normal item. Then any Item that is a child item should have a parent item specified.

your top RG shows the list of normal Items and parent groups, then your inner RG shows child items of the parent item.

RGs should be set to 1 high in the editor and set to full list.

hey. So someone created this. is this what you are looking for? (go to page files)

1 Like

That is really nice, but sadly it wont get past the fact that the RG can only display one data type.

yes you’re right so I created this instead (nested groups)

1 Like

Thanks to all of you for your input.

@ambroisedlg unfortunately I have nothing interesting to share in my editor as I have not been able to build what I need :slight_smile: but here is a more detailed view of my goal, I hope this helps :

@grace.hallak Thanks but indeed my case is a bit different, hope the above picture helps.

@nfish Thanks for your help. This is exactly the solution I went for two days ago. Please find below the data structure I created :

It works to generate the list, but then I do not see how to recreate the groups to link items belonging to subgroups. All job content is considered equal, whether it is a group or item. Ie, I cannot drag and drop or change group attributes and hope that children items and group will follow.

Hi Dawn, you like to keep things simple hey?!

My point goes back around to the fundamentals of bubble logic and how they work with the ‘thing’ abstraction for data. The point I was making is that all of your records are the same thing, items in your case, and you just store what type of thing they are, so Item, or group on their record, then you use that for the RG search. your top RG will be searching for anything in group A, and withing that RG you will have a hidden RG that is going to search for any thing that is marked for group B etc. I can testify to the fact the logic works as I have built a similar system before, although I would admit that its not the most efficient way of working with the data, however it works within the constrains of bubble.

Hey, you mentioned that the above solution of DAWN is working but that it is not the most efficient way. Would you have an example of the version you are mentioning in you post.