DB structure for Form builder

Hi,

I want to build a form configurator where business can create dynamic contact forms. So for example, yes no questions, price sliders, dropdowns etc. They can decide in which order it will be shown. What can be a good DB structure to build this?

Just a little tip…

Bubble does have ‘build guides’ where you can put in your idea and it will give you a breakdown of the database you should use.

When you log in, and before you click on your app…on the left there’s ‘build guides’.

I can’t give a testimonial as to how well it works…but it’s something you could start with.

You can check it out and see if it helps.

1 Like

Build or buy? [PLUGIN] SurveyJS: Form building / form filling (Official)

I have over the years had to un-pick a few attempts at folks creating form builders in Bubble. Creating a form builder product is more nuanced than you might initially think. Reporting off dynamic data structures is even more challenging.

I would pause to think if your business is really creating a form builder product … maybe it is … :slight_smile:

3 Likes

Definitely consider what @lindsay_knowcode recommends.

If in fact, you are building a form builder product, the basic schema is is 3 primary datasets like this (subject to exact use case of course):

  1. Questions - will store the text of the question, the answer type and a number range (potentially as 2 fields) for numeric answers and text inputs (number of chars) and a list of answers for dropdowns / radio buttons etc. (prob also question order and potentially a linked form dataset if you want questions to be grouped under a form)
  2. Answers - only for dropdown / radio buttons (or for all answers for dynamic forms) mostly a text field for the answer and a sort number and a numeric value associated with answer (for grading or determining certain categories) and/or a question associated with the answer if you want to have dynamic questions.
  3. Responses - this is for user’s response. contains the user, question and answer (decision has to be made how to store dropdown / radio button answers if you use the text of the answer or the answer record)

Thanks, will look into that

Thanks for the tip, will check it out. Can this be customizable with my own answer types? Or is it all based on the survey.js library?

Thanks!

For the answers, do you recommend to create an Answer Datatype, with fields like this?
-numberAnswer: number
-textAnswer: text
-imagenAnser: image
-etc

Based on use case, yes. Generally you won’t need a numberAnswer though as the min and max range will determine what the values can be (unless there are only specific numbers that are valid answers)

I’m not sure what you mean by own answer types, but I doubt you’ve thought up a new requirement that surveyjs hasn’t dealt with. :slightly_smiling_face:.

Other tools exist, and you can just build it in Bubble - I’m just suggesting you think about where you spend your very valuable time and headspace. :slightly_smiling_face:

I basically want to allow my users to create forms. I want to give them a few options they can choose from as answer types. For example, a multiple choice, dropdown, price slider, single choice, yes/no, images, or text/number.

It will be a lot of work, but I’m down for a challenge haha

1 Like

For the responses table, would you store the actual question asked OR would you link to the Questions table?

I’m currently linking to my Questions table. However, I realize that if a user edits the question after the question has any number of responses0, it could create various issues where answers and questions don’t align.

Thank you for sharing! I’ve been building out a basic survey this past week and have had to keep it simple to avoid the complexity of a true form builder. SurveyJS will be super helpful

1 Like