Data Structure Issues

Hi Bubblers!

I’m really frustrated with myself for not being able to create what I think should be a relatively simple database Hope you can help me with this :smiley:

I’d like to be able to create a database of questions for Users to answer. I’d like to have a Repeating Group that shows the User a list of Questions (The Question’s Text is Dynamic - I want to be able to build a database of questions and have the Repeating Group show 1 question per cell) and then shows them a dynamic dropdown of possible answers, also within the Repeating Group (The dropdown’s answers have to be related to the question asked: If I ask “What is your favourite Graphics Card”, I need to only be shown the possible answers for that question, e.g. nVidia, AMD to be shown on separate rows).

The user would see a Repeating Group with a dynamic question and their corresponding dynamic answers in a dropdown per cell. But the dropdown doesn’t split a List of Possible Answers into one answer per row, it just lists them all (eg Nvidia, AMD) on one row

Hope you can help me with this; I really am stuck!

Thanks so much!


I’m new enough that this may be a red herring. (My tech background is a bit old and related to Visual Basic.)

Where I would be looking for a possible answer is with the Dropdown, to see if you can fill it with the dynamic list of possible answers. I don’t know how it works in bubble yet, but it would be one possible solution using other development tools.

Good luck.

Happy to help. There are number of ways to achieve this. Can you share your editor?

Also, how many questions max do you want on the page? The reason I ask is that there’s no way to take all of the user’s answers from rows within a RG and submit them to the database at the end. Instead, you’d have to submit them each time the user changes a value on the page.

For our app, we’ve taken all user submitted inputs out of RGs and instead just created multiple groups that show/hide based on the number of, say, questions we have shown on the page. This works well. Only drawback is that I have to copy the group code, say, 10 times if I want to allow 10 questions on the page. And, I have to create 10 nearly identical actions to save the data as well.

Let me know and I’d be happy to help you get a solution working.


1 Like

Hi @sridharan.s ,

Thanks so much for your reply!

When creating an admin creates a question (this will be on a hidden page in the real app), it would be great to be able to add Possible Answers using a RG, but then if that is out, I’m hoping my ‘Add’ button would work as I don’t want to limit the number of possible answers a question could have and don’t want to have to copy workflows etc.

For answering questions, I’d like to show all possible questions within a repeating group, so the user can just scroll through and answer the questions they want. The Dynamic Question text pulls through correctly, but the dropdown doesn’t show the list of possible answers for that question.

I’d just like to show a dynamic list of questions, a linked list of possible answers, then capture the user’s response. I’d then like to be able to look at how many user’s gave a specific answer for a question.

So it doesn’t seem too intense, I imagine it’s a combination of data structure and workflow errors.

Thanks so much for your help so far! Hope you can see where I’ve gone wrong.

Hi Laurence,

Thanks for your reply!

That’s exactly what I want to do :slight_smile: I just don’t know how to bring in a list of possible answers (type = text; ‘This is a list’ = checked) into the dropdown, then only show 1 possible answer per row, then save the user’s choice into the DB.

Here is how I have done exactly this …



Probably a lot more complex than you need, but that structure should be the same.

The key here is to deal with the many <> many relationship between Answers and Users. Answers are given by many Users, and Users give many Answers (for User here see Email as we don’t require logins).

That is what “Vote” is … it is a single user voting for a single answer. And Questions have multiple answers.

Using the “Vote” table you can get to whatever you want.


It looks like @NigelG has explained the DB side of this in great detail so I’ll skip that part.

As for the UI. You have two big-picture options for both the questions and answers:

  • Put them in a RG and then save the result to your database each time the input value is changed. This worked for us in a prototype but wasn’t reliable enough for a production grade app. As such, we remove all of them. Your mileage may vary.
  • Build out groups that show/hide based on the number of questions/answers. It’s more tedious to set-up and more tedious to change in the future. If you went this route, I’d recommend using a reusable element for the questions and then using a custom state to store the answers on that element and then save that data to your database at the end of the page. This way, the reusable element minimizes the amount of rework and replication.

Please note, I made the mistake of thinking I could both have simple code (like a RG) and also reliability and performance (like the show/hide groups) all at the same time. Probably wasted at least 2 weeks trying to achieve this, so my advise to others is to accept there’s a limitation and then choose the path that makes the most sense because none of the solutions are perfect.

So, while we also didn’t not want to limit the number of questions or answers, it became pretty obvious to us the none of our users ever used more than 20 of either. So, that’s the route we took.

Best of luck!