Dynamic form submission - creating multiple DB entries

Hi there, I’ve built a dynamic form builder for our users where they can create multiple types of questions for forms, ie. file upload, data-picker, short text entry, etc.

When they create the scheme for their form, a form ID is created, and then an array of question IDs are associated. Each question schema has its own DB entry.

This works great for form creation and rendering.

Where I appear to be hitting a bubble limitation is in handling form submission. I’m looking to understand how bubble can loop through each rendered question and save the input response in the DB as its own line item.

We need each answer as its own line item (relating back to the question ID) to maintain CRM integration field mapping for being able to post back to the CRM ultimately.

Long story short, has anyone cracked the code on these types of dynamic forms?

I save each answer as a text. The answer and unique ID of the question joined with|.

I don’t recommend concatenating both the answer and UID in one field. for what purpose?

Why a UID anyways and not a link to response or nested within response?

In terms of your question, I’m not necessarily understanding it but if you mean to give the user the option to save an answer as a certain field in the CRM, why not give the user a dropdown of CRM fields to link to the response in the form admin (i.e., when they pick type of answer just another field for which CRM field the answer should be saved as)

OP is asking how to save the submissions while keeping the link to the question datatype. Correct me if I’m wrong

Whats wrong with concatenating? I use this method for indexing complex data and never had any issues.

There isn’t a desire to concatenate inside of one field.

I want to loop through n number of questions on the form and create a new ‘thing’, which is an answer for each associated question.

Regarding the CRM mapping - that is already set in the schema of the form creation. My point is that I do not want to create a state as a list and save all of the answers as a list because it’ll be incredibly inefficient to untangle that later when making the API call back to the CRM.

The simplest way to this about it is if there is a ‘bubble’ way to do…

for f in form:
save f as a new thing

If looping through an RG is what you’re looking to do (assuming you are using an RG to display the questions in the form) then you can either use a plugin like Orchestra or use multiple custom events to loop through the state list (you’re going to have to store it somewhere) and create the DB entries.