Create a new group dynamically


In my app, I have a group, pressing the + icon will create a new thing with text saved as fields.

Is it possible that in addition to the above, when I press the + icon, a new identical group with the two input fields and icon will appear right below it?
In addition, I want the newly generated icon to have the same workflow, i.e. creates a new thing and generates another identical group below it.

Input fields don’t seem to work in repeating groups and I don’t know how many groups my users want to create.

Any advice greatly appreciated,

Hey @alex8,

You should take advantage of the Repeating Group element, which repeats a block of content with its workflows as many times as needed. When working with the Repeating Group, you’ll only be concerned with creating just one example of what’s required which in your case could be the two inputs and icon that create a new record in your database. Just make sure that the Data Source field of your Repeating Group will expose those records you’re trying to create, such as setting it to Do a search for… and so on! :slight_smile:

I totally agree but you can’t put input fields in repeating groups?
for example:
In my editor I have a repeating group with 1 input and 1 Icon

though when i preview, no inputs or icons are shown.

In addition, if I look at the workflow for the icon, I am not sure how I would ‘add another row / repeating group’ which mimic’d the workflow?
How would I save ‘one input and one icon’ in the database?

thanks @copilot!

If your Data Source isn’t returning any records to fill up the Repeating Group with, nothing will show. If you don’t want the input(s) and icon to shift or be invisible without any records, place them outside of the Repeating Group. You can use the Workflows’ Create a thing action to create a Group, and set the Data Source for the Repeating Group to be set ‘Do a search for Groups’. Refer to Bubble’s tutorials and guides for some basics. :slight_smile:

wait sorry - how do I set a thing to be a group?
When I create a new thing, I have to define field types which are pre-set - how do I create a group as a thing??
Would be super grateful if you could point me to the guides, i’ve been searching and havn’t been able to find :confused:
Thanks for it all

A ‘Group’ in this case would be a Data Type in your Data tab. Concepts like Data Types, Data Fields, Records and others all relate to data as a whole, which is covered in areas such as Bubble’s documentation and much throughout other posts here in the Forums. If you’re looking for something a bit more formatted and video-based, check out our What is Bubble? course. You’ll need to have a solid understanding of data architecture to build out capable applications so it’s good to get a grasp of those before you start building. :slight_smile:

1 Like

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