Linking one repeating group to another

Hi all, I’m new to Bubble and just started to build something that I’d previously designed in Miro. I have successfully created a grid with a repeating group in it, that also allows me to click new items for the repeating group; edit them; and delete them. These items are a many:one relationship with the current user, so I created a relationship between a new data type to hold those items and the user (so let’s call them “children”).

The next thing I want to do is set up a new grid that enables the following:

  1. each child is shown on a separate row - this is fine, I just copied the previous repeating group and made it 1 column wide. There are not always a fixed number of children.
  2. using a similar approach as before (buttons to create new records etc) I want to create multiple “grandchildren” for each “child”. I have created a new data type for the grandchildren, and defined a relationship between that datatype and the child one, but now what I need to do is somehow link the “child” repeating group to the “grandchild” repeating group so that when I create grandchildren they are related to the right child. Does that make sense?

Hello @debbie welcome to the community!

If I understand correctly the database structure would look something like this:

Database Structure:

  • User
    • (Various fields)
  • Child
    • User (type: User)
    • Grandchildren (type: List of Grandchildren)
    • (Various other fields)
  • Grandchild
    • Child (type: Child)
    • (Various other fields)

The setup described would involve two repeating groups:

  1. Parent Repeating Group for Children: This is the main repeating group that displays each “child” on a separate row. It’s the one that is already created and made one column wide.
  2. Nested Repeating Group for Grandchildren: Inside each cell of the parent repeating group for “children,” there would be a nested repeating group to display the “grandchildren” related to the current “child.” This allows for the creation and display of multiple “grandchildren” for each “child.”

So, in total, there would be two repeating groups, with the second one nested inside the cells of the first.

Hope this helps! :smiley:

That worked - thank you! So now I have another issue, related to the same thing. I have manually (admin) created grandchild data and noticed that the “joining” field in the grandchild table doesn’t actually show the text as it’s set in the child table - instead it shows a long string on letters and numbers, and when I create the grandchild record and type the text from the child table it finds the right one but only displays (and stores) the long string. Is this correct?

What I’m wanting to do now is to create a new grandchild record from a popup form - but in order to do this I need to include the “joining” field, and I can’t work out where to get that from?

Many thanks!

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