# Looping Over Multiple Blocks with Branches

CaliforniaCommunity Member Qubie ✭

# Looping Over Multiple Blocks with Branches

Hi.

I have a created survey (actually quite simple). There is one question that I'm calling the anchor question that looks something like this?

Where did you go next?
a. home
b. school
c. store
d. library
e. I went nowhere else today.

Basically, each answer solution a-d triggers custom questions about that specific location (that I have in the survey flow). Choice e is basically the escape character. It is unknown how many places a person went in a day. It is also possible that the person went to the store multiple times that day. Each response a-d has its own block with the questions specific that that answer. I would like to loop over this question and the response-specific questions until choice e is selected. Anyone know how to do this simply?

Thank you!

• Qubie ✭

@KLBoles said:
Hi.
No. Not quite. Let me be a bit clearer.

The loop starts with the anchor question:

Where did you go next?
a. home
b. school
c. store
d. library
e. I went nowhere else today.

If (b) school is chosen, they receive follow-up questions like:

b.1 What courses did you have in school today?
b.2 What did you learn today?

When those questions are completed, they need to go back to the anchor question:

Where did you go next?
a. home
b. school
c. store
d. library
e. I went nowhere else today.

This time, they might choose (c) store. They would receive follow-up questions like:

c.1 What store did you visit?
c.2 What did you purchase?

Where did you go next?
a. home
b. school
c. store
d. library
e. I went nowhere else today.

I would be comfortable with assuming they only went 15 (max i) places during the whole day... that is we would - at max - need to return to the anchor question 14 times. However, lots of people will not have visited 15 places in the day, so when they choose choice (e) "I went nowhere else today" it needs to act like an escape character - never again returning to the anchor question.

I hope that makes more sense. Thank you for trying to help me!

Please see this preview survey and is this how you want ?

• IndiaCommunity Member Guru ✭✭

Hi @KLBoles
You have to decide the number of loops you want to keep for each block as you cant keep a infinite loop.
After each selection you can ask a question like - How many times have you visited ....?
If you want to keep the loop for max 5 times then you can keep predefined answer options like, Once, Twice .... More than 5 times
Based on the answer of this question you can loop the relevant block.

• CaliforniaCommunity Member Qubie ✭

Right. I understand that you would normally loop for a set number of times. However, in my case, this value should be user defined. This is why I am using response "e" as a sort of escape character/break. Thoughts on how to do this in Qualtrics?

• CaliforniaCommunity Member Qubie ✭

Note: We can set some max i (~15), but responders would need to be able to break out of that loop before 15.

• Qubie ✭

@KLBoles said:
Note: We can set some max i (~15), but responders would need to be able to break out of that loop before 15.

• CaliforniaCommunity Member Qubie ✭

I have read all through the loop/merge resource. It doesn't all me to do what I am trying to accomplish.

• IndiaCommunity Member Guru ✭✭

As you are saying the number is user defined(max ~15), are you asking a question like after selecting each option - How many times have you visited ....?
So If anyone selects Shop, then it will ask - How many times have you visited shop?

• CaliforniaCommunity Member Qubie ✭

Hi.
No. Not quite. Let me be a bit clearer.

The loop starts with the anchor question:

Where did you go next?
a. home
b. school
c. store
d. library
e. I went nowhere else today.

If (b) school is chosen, they receive follow-up questions like:

b.1 What courses did you have in school today?
b.2 What did you learn today?

When those questions are completed, they need to go back to the anchor question:

Where did you go next?
a. home
b. school
c. store
d. library
e. I went nowhere else today.

This time, they might choose (c) store. They would receive follow-up questions like:

c.1 What store did you visit?
c.2 What did you purchase?

Where did you go next?
a. home
b. school
c. store
d. library
e. I went nowhere else today.

I would be comfortable with assuming they only went 15 (max i) places during the whole day... that is we would - at max - need to return to the anchor question 14 times. However, lots of people will not have visited 15 places in the day, so when they choose choice (e) "I went nowhere else today" it needs to act like an escape character - never again returning to the anchor question.

I hope that makes more sense. Thank you for trying to help me!

• CaliforniaCommunity Member Qubie ✭

Yesssss!!! This is it! How did you do it? Thank you SO much!

• BrusselsCommunity Member Qubie ✭

@Shashi said:

Please see this preview survey and is this how you want ?

Hello !

I am very interested in this, could you describe the process ?
I read the document you attached in your other comment but couldn't replicate what you did in this preview (and the preview is exactly what I need).

Thank you !