Loop and merge a block an unknown number of times | XM Community
Skip to main content
I have a survey block where respondents will answer questions about previous jobs that they have held. I do not know how many jobs they have held. I do not think that they will know how many jobs they have had until they think through all of them (i.e. if I asked them at the beginning they might think they've had 5 jobs, but then as they fill out information they will remember that they forgot a job and actually had 6 jobs). Therefore, I want to have a question at the end of the looped block, "Are you currently at this job?", and if the answer is "Yes", I want to stop looping. In the Loop and Merge logic, I check "Loop based off of a question", then I have to choose "Select choice". I do not know which one of these choices will allow me to loop as long as the answer is "No" to a question within the loop.



Thanks,

Matt
Create a loop and merge with some maximum number i.e. do not check the 'loop and merge based off a question' option.



Now create the first question of loop and merge block "Are you currently at this job?" and add display logic as - If Loop 1: 1 Not Current Loop

And ""Are you currently at this job?"" (All Loops) no Is Not Selected



For other question in the loop and merge block have this display logic - If "Are you currently at this job?" (All Loops) no Is Not Selected
Thank you so much! I changed the display logic from No is Not Selected to Yes is Not Selected. I had some problems with the logic not working until I logged out and then in again. Now it works perfectly.
Hello, this is exactly what I am trying to accomplish--I am not sure I entirely follow the solution. So, for example, let's say I have three questions: 'Your Job Title', ' Your Company Name', and 'Are you currently at this job?'. Would I hold those three question in the same block or do they need to be in different blocks to loop & merge? Any chance someone could share screen shots so I can have a visual of the steps? Any additional help would be so very appreciated. Thank you!
I can't share a screenshot because my survey has some sensitive information, but:



Block: History of Positions



Question 1: Are you currently at this job?

[Display this question if: Loop 1, not current Loop] AND

[Are you currently at this job? (All Loops) Yes is Not Selected]



Question 2: Job Title

[Display if: Are you currently at this job? (All Loops) Yes is Not Selected]



Question 3: Company Name

[Display if: Are you currently at this job? (All Loops) Yes is Not Selected]





When setting up the loop and merge, it defaulted to looping twice and then shutting down. It didn't give me an option to change that. I then clicked the box, "Loop and Merge based on a question", chose a question that had 25 options, then unclicked the "Loop and Merge based on a question". That workaround gave me a max of 25 loops. I don't know if was bugged for me or if this is a general issue.
Aahh, okay, I see where I was getting stuck--Thank you so much for taking the time to outline that structure, how very kind of you! Best of luck with your project.

For a long loop of questions, it's a pain to enter in all of the display logic question by question. Would it still work with a skip logic, i.e. if they don't have any more entries to add, skip to end of block?


End of block in any question of loop and merge block means end of current loop. So we cannot use that.


Leave a Reply