I am fiddling around to create a dynamic survey. I would like to know if it is possible in Bubble and what is the best approach to develop the survey front-end and saving the results in the database.
What I want is to render a survey that is configured in the database (creating an interface to create questionnaires like this will come later)
I have a survey that has questions of a specific order and type. Types I want to support are:
Open question (text)
single select out of a set of answer options (radio)
Multi-select out of a set of answer options (checkbox)
Yes/no
Slider/likert (1-5)
Beside the order of questions I also want to have a define a conditinal order. In other words skip question(s) based on a specific answer.
Having this approach from the database perspective. I want to use a group that has datatype survey. In this group I want to put a repeating group for questions. In each question I want to have a group for each question type, which is shown based on a condition on question type.
If a choice needs te be made from a set of answer options I want to use a repeating group in the question group rendering the answer options which radiobuttons or checkboxes
Then when an answer is given I need to check if conditional question flow applies and if so which questions needs to be shown/hidden.
At the end of the survey the user saves the survey and answers will be stored in the database or I save it after each questions.
Is this kind of set-up possible in Bubble and is it smart to use repeating groups to render the questions and answer options. Iâve read somewhere on this forum that receiving answers from a repeating group is not the best approach. I also have some doubts that loading the survey can feel rather slow.
Further more, is it wise to use custom states for the conditional flow or should I use the database?
I would like the receive some insights just to be sure I can start from a good baseline rather than going down the rabbit hole
Hey, did you get to a good solution to this in the end? Iâm doing something similar with a booking system that is dynamic depending on the type of service being booked etc.
HI â Found your question, I am also trying to do this questionnaire/survey with skip logic and branching etc, to get a customized user/ buyer profile which connects to certain service that are appropriate. I didnât get too much response to my question last week. Curious what direction you went in. QuestioinPro does exactly what I need and there is a zapier integration, but thatâs probably not a solution for a marketplace style app I want to build.
Hi Jared: Went the route of signing up with a Bubble consulting group to help me build this and learn Bubble in early January. But seems to be very possible.
Okay cool - I am going to try to build it myself throughout January / February so we will see how it goes. Out of curiosity, how much are they charging you for the service?
It was a sort of hobby case, and the past months I didnât had time to Bubble as much as I wanted. I am planning to try to built this use case in the beginning of next year. So no solution yet. But letâs share our insights and findings and progress here to help each other out!
I looked into that. Really cool is the way the submissions are designed. Somehow it creates dynamic columns for each question in the form. No clue how to do that in pure Bubble.
It is definitely possible to make something like this in Bubble. But it can take a fair bit of time and Bubble skill to make depending on the exact functionalities you need.
If you want to make a standard survey that you donât need to regularly change and you are the only one creating and editing it than it might be easier to âhard codeâ the questions and logic in the Bubble editor instead of having them be dynamic data types.
If you want a more of a dynamic form builder (as I take it most of you do), then I recommend starting with as few âQuestion typesâ (text, number, phone, dropdown, multi select, radio buttons, etc) as possible as each one requires more complex structuring and conditions. In my template there 5 different question types you can use. But it does not have the ability to add âlogicâ based on previous answers - this could be a rather advanced build depending on how the logic should work and how âsmartâ it should be.
As with any app build, make sure you fully plan and scope out the product and features before you start building. It may seem simple what you want but there are actually a ton of decisions that go into the design of this type of app and each decision can change the structure and work needed to build it. Hereâs a few considerations that could add a lot of complexity:
how many âpathsâ can the survey lead down (total permutations)
how many previous answers are needed to determine the next question (always one answer, or multiple)
are calculated values need to determine the next question
will the next question require dynamic values from previous answers
how do you want the Results of the survey to be displayed or used (more complex reporting can lead to more advanced development)
Best of luck with it, itâs a fun type of project to work on in Bubble
Hi Jared,
I experimented with several approaches and settled on a semi-hard-coded solution. Fully dynamic (i.e. database driven) is actually much more complicated than it first looks, particularly if you want to be able to go forward and back in the form.
Approaches I considered:
Hard coding using show/hide and/or custom states: a complex web of workflows or conditionals e.g. âif x selected, show group y when next is pressedâ. This will work and is easy to implement, especially for shorter or simpler forms.
Question lists: generate a list of questions (a data type in database), which then changes based on responses. e.g. âif x selected, add question A to current userâs question_listâ. Each question answer had a ânext questionâ attached to it in the database. I then had a custom state called âcurrent questionâ, which essentially was driven by the current question in the question_list + 1. This works if your question order doesnât matter, but you canât slot questions in between others i.e. it is a linear list.
Semi-hard-coded: we created question answers as Options, with ânext questionâ as an attribute. So for example, if you selected option B, it would set the ânext questionâ custom state as option Bâs next question attribute. The next question would then show based on a conditional parameter (e.g. when next question is Z, show group Z). This works but is quite time consuming to implement. It does have the advantage of being able to change the options and next questions in the Option rather than searching through hundreds of workflows.
Ultimately, we didnât find an elegant solution to the problem but it does work. The best thing we did was map out the entire form in Excel with each question, answer and the next question for each answer.
If anyone has better options then very keen to hear it
Hi Jared; sorry for delay its about 3k I believe for an entire 12 week course that gets you to an MVP as a whole, or at least that is the plan. So far so good. Regards,
Awesome. Thanks for your input! I think I like option two the best if Iâm trying to avoid hard coding. If I pursue this project further, I will let you know how it goes!