I’ve been using Bubble for a week. As a first project, I’m trying to build a simple Q&A app. I’m basically following this tutorial from the blog.
I have a challenge with the “Submitting & displaying answers” part of the tutorial. Here it is in a nutshell:
If I post two questions, let’s say question 1 and question 2, and I intend to post an answer 1 to question 1, it also appears under question 1, which was intended, but also under question 2, which was not intended.
Here are a couple of screenshots from the tutorial that I’m following.
I’m not sure what dynamic data I should insert instead of Current cell’s Question answers’s Answer content so that answer 1 only appears under question 1, answer 2 under question 2, and so on.
I also inspected the database and my workflows but could not detect the source of my mistake.
Your solution will depend on how your database is set up. If your answers are being displayed under multiple questions, you likely have one of the following going on:
You aren’t properly linking the question and answer together.
You aren’t properly displaying only the answers related to a particular question
There are generally two ways for establishing 1 to many relationships (1 question, many answers) in bubble. You can create a list of answers on the question item, then display that question’s answer list. Or, you can create answer items with a Question field, then display “Do a search for Answers: Question = YOUR QUESTION”.
It seems to me that the answer is properly linked to its original question, or did I miss something?
For the time being, the repeating group contains a list of answer items with a Question field. Yet I didn’t find how to display a search for Answers: Question = My Question as you suggested.
You can set the data source of the repeating group to:
“Do a search for Answers”
And for the parameters, set the following:
Original question = Parent group’s question
This assumes that the repeating group is in a group with the data type set to Question, and the appropriate question set. You can replace “Parent group’s question” with any reference to your question object.