Create a loop in the survey flow | XM Community
Skip to main content

Is there a way to create a loop in a survey flow?

For my survey, I have 2 groups of questions - Group 1 and Group 2. Under Group 1, there are 20 rating questions, along with 20 timing questions. This is repeated for Group 2. I would like to set up randomization, such that it’s something like this:

  1. Group 1: Rating question 1 + Timing question
  2. Group 2: Rating question 3 + Timing question
  3. Group 1: Rating question 2 + Timing question
  4. Group 2: Rating question 1 + Timing question
  5. … And so on until all 20 questions from each group have been answered.

I have tried to set up randomization in the survey flow as follows. However, I need a ‘loop’ function such that the randomization pattern will repeat for all 20 questions, but I am not sure how to do it.

 

(I have yet to create all 20 questions - I have created 2 for now)

Any help is appreciated!

 

@felicianse,

There is no way to create a loop in the survey flow.

Alternatives:

  1. Use a randomized loop & merge block with both Group 1 and Group 2 questions in the block. Each loop will represent Group 1.  Randomize fields related to Group 2 in advance and pipe them into loop & merge fields.
  2. Repeat the items in your survey flow 20 times. Add branch logic so that each rating block only gets asked once.

@TomG 

Thank you so much for your response! I do have a follow-up to ask:

I have tried adding some branch logic as I am unfamiliar with loop & merge. I have come up with something, but it does not seem to work. I believe that I need to add a function to make the flow jump to the next branch in case the first condition is not fulfilled, while at the same time, randomizing the order of which these branches are shown.

 

Here’s a detailed example:


 

  1. Group 1 Question 1: A random question from the list of group 1 questions will be selected.
  2. Group 2 Question 1: A random question from the list of group 2 questions will be selected.
  3. Group 1 Question 2:
    1. If Q1 from group 1 was previously answered (‘Not empty’), a random question from the list of group 1 questions will be selected, excluding Q1.
    2. If Q2 from group 1 was previously answered (‘Not empty’), a random question from the list of group 1 questions will be selected, excluding Q2.
    3. 2A randomizer was included before these branches, to randomize the order of the conditions such that there is no predictable pattern for the next questions to be shown.]

However, the issue now is that if this occurs:

  1. Group 1 Question 1: G1 Rating1
  2. Group 2 Question 2: G2 Rating 2
  3. Group 1 Question 2:
    1. Branch that was randomly chosen: “If Q2 from group 1 was previously answered (‘Not empty’), a random question from the list of group 1 questions will be selected, excluding Q2.”
    2. Result: No question is shown at all

 

Thanks again for your help!


@felicianse,

Set up a group that you can copy 19 times. It would look something like:

Group: Set 1 (this will be copied for Sets 2-20)
Randomizer: display 1 evenly presented (Randomize group 1)
Branch: If G1_Q1 is Empty (has not been answered)
Block: G1_Q1
Branch: If G1_Q2 is Empty (has not been answered)
Block: G1_Q2
...
Branch: If G1_Q20 is Empty (has not been answered)
Block: G1_Q20
Randomizer: display 1 evenly presented (Randomize Group 2)
Branch: If G2_Q1 is Empty (has not been answered)
Block: G2_Q1
Branch: If G2_Q2 is Empty (has not been answered)
Block: G2_Q2
...
Branch: If G2_Q20 is Empty (has not been answered)
Block: G2_Q20
Group: Set 2 (copy of Set 1) ...

 


@TomG 

 

Thanks for your help again. Apologies as I may not have been clear previously.

 

I realised that there is a problem: if the randomizer lands on a specific branch where the condition is not fulfilled, instead of picking another branch, it moves on to the next section completely. Is there a way to solve this?

Thanks so much again!


@felicianse - The randomizer only picks from ‘true’ branches.


Leave a Reply