Forum Academy Marketplace Showcase Pricing Features

How to insert the right dynamic data? (challenge with building a Q&A app)

Hi everyone,

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.

2

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.

What would you suggest?

Thanks.

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:

  1. You aren’t properly linking the question and answer together.
  2. 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”.

Hope this helps


Getting stuck with your bubble app? Reach out to us at protomakr.bubbleapps.io

1 Like

@austin3 Thanks for your reply. Much appreciated.

I’ve tried to debug my issue and still either a given answer appears under all questions, or it does not appear at all.

Here’s a preview of my Questions data type:

And here’s a preview of my Answers data type:

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.

Anything I might have missed jumping out at you or shall I provide more context ?

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.


Getting stuck with your bubble app? Reach out to us at protomakr.bubbleapps.io