Forum Academy Marketplace Showcase Pricing Features

Save Dynamic Input Fields within Repeating Group

Hi Bubblers,

imagine repeating group which has in each row input (text or image or list - its coming from DB).
User should be able to fill in inputs and save them all at once or one by one (binded fields). Binding is not possible however because binding you need to do manually as I understood (so not suitable for dynamic form).
To generate such list is possible and here is example:

PROBLEM:
I can not save the form. Why? All the inputs have same name and I can not identify (dynamic) inputs in workflows. In Bubble we can not name elements in dynamic way, it is one thing which seems to be hardcoded.

I also seen approach - On Change of Input, Save state to Custom State of some page element. However this is also not working. Repeating group returns dynamic results (e.g. 20 input fields, 5 image uploads, one list. I can not in advance to create all possible states and then to fill them when someone clicks on input. (sorry this part is quite confusing).

Possible solution?
I was able to name ID of each input element in repeating group. So I could identify inputs in Bubble by ID - and assign them correctly in database, however I do not know how to use this when creating/updating data.

Have a workflow for each input that sets a specific state based on current cell’s index. For example, on your RG you can set a custom state for each field named accordingly with the correct data type. Then on the workflow for the input you can say set the state of RG’s firstState to equal input’s value only when current cell’s index is 1. And then add a conditional for each index. Then when you hit the save button you can access all the data from custom states and even add rules to alert the user if they did not fill out a required field.

Hi @williamtisdale,

I appreciate your reply. After reading multiple times I understood it just partially. I understood it following way:

  1. Repeating group will get manually created custom states (in advance in bubble editor).
    FirstState (text)
    SecondState (image)
    etc…

  2. By workflow On change of input I will check Only when Current Cell’s index is 1, set value for FirstState…etc

This approach requires that I know how many fields (states) I have and to link them one by one manually in workflows. Perhaps there would be some saving with recurring workflows (for now I’m not on paid version so could not play with it)

I’m afraid this is not dynamic. What if I get from DB e.g. 10 more NEW fields tommorow. Do I need to manually create states and then assign them in workflows?

Thanks

I was answering under the assumption that these were a set number of fields connected to a data type, in which the suggested solution would suffice. You are saying these are fields that will change? What are the fields connected to exactly?

I have a table (thing) called FormTemplate. Fields in FormTemplate are added to DB by user as needed and it is done in other page. Imagine user is creating fields which he/she wants later to use in his specific project. In dependance of usage certain fields will be used and I have no idea which. Therefore manual creation of placeholder states seems like temporary/partial solution.

Back to FormTemplate: Each row contains data like
field name, field type, field default value, image field, text field, number field, list field, etc…plus some relational fields which are linked to company thing/table.

When I do Repeating Group from FormsTemplate, I get result as you can see in screenshot above.

I would need somehow to tell bubble to store each field on save. For this Bubble should allow to name repeating group inputs and recognize them. I was able to save individual fields using “input on change” and states, it just seems bit awkward & hardcoded solution.

I think for what you are doing your solution is all that can be done.

I don’t know if it could work, but on a video, Gaby used an API call to send 2 linked datas. But I didn’t understand so well. But maybe it could work to send several data, like, text, etc.

Check out this video after 13min 40s