How can I create one loop inside another loop? | XM Community
Skip to main content

Hello!

We would like to have one loop inside another loop. For example I have one loop with questions about the x persons of a family. So I create the loop and everything works fine!

But let's say I want also to ask each person about their n favorites books, so one person could talk about 1 book and another about 5 books. But I still need to be within the first loop so when I finish the questions about the books y can ask them any other things before finishing the main loop and continue with the next person.

It would be great if we could make this work.
Thanks!

If this is only related to asking about a thing for n times, then in the loop and merge block simply ask the question as number of books read and keep some max value custom validation on it.
Now you can create a side by side question, with max number of statements that you have mentioned in previous question. Apply option display logic on each statement of side-by-side question as for example, on statement 3 the logic will be if number entered in previous question is greater than or equal to 3, similarly for other statements.
Side by side question is suggested because it can have multiple type questions for single statement, else we can use any question type but apply display logic accordingly.


You will have to create set of question inside the loop and merge for the second loop. Suppose you need nested loop to get asked for 5 times then inside the loop and merge, create 5 questions and add the conditions for each question.


https://www.qualtrics.com/community/discussion/comment/27611#Comment_27611Hello Rondev,
Thank you for four response!
That would work if there were only 1 or 2 questions for the second loop, but we have 10 questions on this. Also we can't put a limit, so if someone wants to talk about 8 or 10 books, we should let him do it.
So, even with that I would need to create a lot of questions and logics that I don't think is efficient enough.
Isn't there like a possibility maybe with Java or something that letme repeat the questions n times?



https://www.qualtrics.com/community/discussion/comment/27612#Comment_27612Hello SurajK,
Thank you for your response!
The problem here is that isn't only one question on the second loop, there are 10 question for this! So, even in that scenario I would need to create 50 additional questions and set 50 display logic just for the second loop.
I think that I will have to do that, but I'm hoping to find something that allows me to do this without making the survey so complex!


Leave a Reply