Inserting info from an API into nested repeating groups

Hello bubble community!

I am still a new bubble user and have been struggling with making this work. So any help/tips would be greatly appreciated.

Basically, the idea would be to click a button, in order to create “Header1”. “Header2” would be created by clicking that button again, and so on.
Next to “Header1” would be another button that would open a pop-up or a new page which contains a list of Body names. Clicking that name would make it appear under the corresponding Header, depending on the button that was pressed.
For example it would look something like this:
“Header1”
…“Body1”
…“Body2”
“Header2”
…“Body3”
…“Body1”

The header creation and the pop-up + API connection work, but i am so lost trying to figure out how to make the “Body” part work.
Sorry if i was not clear enough, i could try to elaborate more if needed.

Hello,

I’m not sure I do quite understand so apologies if this advice doesn’t help - feel free to add more details. I’m also not sure where the API comes in, but perhaps that doesn’t matter for now.

Depending on how much data you’re planning to handle, I’d say that on the data type that holds Header items you should have a “Body Items” field.

On the popup for adding/selecting Body items, set the “Type of content” as the Header type and pass the popup the current cell’s Header (i.e. from your main page).

When you are adding/selecting Body items in the popup you can then “Make changes to thing” popup’s Header → field Body Items → add this Body.

As I said, I may have misunderstood so feel free to provide more context.

James
AppEDGE

Hello James,
Thank you for your reply.

I will try to clarify more with this image, it is the result i would like to have.
There would be two API connections, one for the “Body” and one for the “Body_content”. The API gives back a list of items to choose from.
The “Add Header” just adds a new header named “Header 1”
The “Add Body” button opens a pop-up linked to the Body API. After selecting a body item, it gets placed where “Body 1” is in the picture.
The “Add content” button would do the same as the previous button but one step further down, using the second API.

I had tried the method you suggested but data would get duplicated: Adding a body to header 1 would add it to header 2 as well.

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