Loop in a loop | XM Community
Skip to main content

Hello,
I have a problem with a survey, where I need to use a loop within a loop if possible.
The participants will go through a short first block (B1), that does not repeat. The last question of B1 asks (in the form of a free entry text) how many articles they found on a different platform. This number could be anything between 0 and 1000. The second block (B2) then should repeat as many times, as many articles the participant found. Following a first few questions, B2 also ends with a free entry text question: how many projects does that article contain. This answer could again be anything between 0 and 20. The next questions should repeat as many times as many projects the participant indicated, but also by articles. E.g. if there are 500 articles and every one of them mentions 3 projects, then the project-related questions should repeat 1500 times.
At the moment, these project-related questions are in a separate block (B3) and I have tried to set the Loop logic with making the last question from B2 to be the basis, but the system does not allow for that (it simply only offers questions from B1). This makes me think, that one cannot make a loop nested in another loop. Or am I wrong? Including the project-related questions in B2 would not allow for the loop technique as much as I know right now.
After describing my problem, does anyone have a suggestion how to solve it?
Million thanks!

You are correct; you can't nest loop & merge blocks in Qualtrics.
A solution would be to include 20 sets of 'B3' questions at the end of B2 and add display logic to them based upon the answer to the 'how many projects does that article contain' question.


https://community.qualtrics.com/XMcommunity/discussion/comment/45637#Comment_45637Thank you TomG for your answer!
I have received another suggestion from Qualtrics Support, that included passing information via a Query string (https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/passing-information-through-query-strings) and redirecting respondents to the same survey (https://www.qualtrics.com/support/survey-platform/survey-module/survey-options/survey-termination/#RedirectingRespondentsToAUrl).


Actually, you can mimic nested loops. Take a look at the "Nested Loops" in Qualtrics document on https://researchguides.library.syr.edu/dataservices/Qualtrics . Further down in the videos section is a tutorial on repeated testing in Qualtrics that uses some of the ideas in the suggestions you got from Qualtrics support. Perhaps some combination of the two will get you where you want to be.


Thank you phbern for your answer!
What the "Nested Loops" document suggests is essentially the same as what TomG had also recommended. In my opinion, it is a feasible method as long as the number of the second loop is a manageable number.
Unfortunately, I could not find the video that you were referring to 😐


Hi Nikolett,

Hopefully this ink will be better.
https://researchguides.library.syr.edu/dataservices/Qualtrics#s-lib-ctab-14642508-4


Leave a Reply