Working with two different data types in a repeating group

I am building a staff survey for a workplace. I’ve created a data type of question, and a data type of answer, and added all the questions to the database. The answer data type has a question field, which I plan to use to link each answer to it’s question in the question database.

I have created a repeating group and added the questions and a slider input. The questions display find from the questions in the database. I want the slider input to function by adding (or updating) an answer where the question field is the same as the question displayed in the repeating group. I can’t figure out if there is a way to do this?

Is anyone able to help? I’m happy to clarify anything if what I’ve described is unclear!

Hello,

This thread might help. Thank @adamhholmes later Combining repeating groups - #5 by adamhholmes

Although if you simple want to show the answer to each question and since you mentioned the data type question has a answer field, why not simply make your repeating group’s data type as question and each cell’s question will have a current cell's question's answer ?

Hope this helps…

Best,
Nino

Hi Nino, this would work if each question had a set answer, but what I’m trying to capture in the Answers data type is each user’s response(answer) to the question. I hope that makes sense?

Hi Nino, I think I found an alternative solution to this. The Questions are all likert scale questions, so I can add fields for each likert score to the question data type and then add the user’s score on to the total e.g. When a user clicks on ‘strongly disagree’ I can add 1 to the ‘strongly disagree’ field of that question. It seems to work ok.