Loop & Merge
About Loop & Merge
Loop & merge allows you to take a block of questions and dynamically repeat them multiple times for a respondent.
For a quick example of what loop & merge can do, view our Loop & Merge Example Survey.
Turning on Loop & Merge
- In the Survey tab, click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
Once loop & merge is turned on, you can specify how your block of questions will be repeated. Choose to loop based on:
Looping Based on a Question
Looping off of a question allows you to present respondents with the same block of questions once for each of a previous question’s choices.
Survey setup
Before setting up this loop & merge, you’ll need at least 2 blocks of questions in your survey. The first block should contain a question that will determine which loops to show to the respondent, usually with a multi-answer question. The second block will be looped.
Look at the screenshot above. In the first block (Default Question Block), respondents are asked which departments they shop in. They will then loop through the Product Awareness block once for each department they select.
Looping based on a question
- Click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
- Click the Loop based off of a question checkbox.
Qtip: A block can be looped based on the following question types: multiple choice, matrix table, slider, side by side, text entry, rank order, constant sum, pick group and rank, and hot spot. - Select the question and choose which answer choices should trigger the loop. Options will vary depending on the question type, but in most cases you’ll set this to Selected Choices, because that implies a loop for each of the options the respondent selected.
Qtip: You cannot select any questions that are in blocks with loop & merge already enabled.Qtip: If you have Allow Text Entry set up in the question that your loop is based off of, you can choose Selected Choices – Entered Text to see the typed answers when piping in fields.
- If desired, select Randomize loop order. See link for details.
Attention: Although you can export the responses given for each field, you cannot export the order in which the loops were presented to the respondents.
- Click Save.
Looping Based on a Number
You can use a text-entry question to determine the number of times to loop through a block. That way, you can customize the number of times each respondent loops through the same questions.
Survey setup
Before setting up this loop & merge, you’ll need at least 2 blocks of questions in your survey.
The first block should contain a text entry question that will determine how many loops to show to the respondent. Set this text entry question to numeric format. The second block will be looped.
Example: In the “Loop & Merge Condition” block, respondents are asked how many children they have. They will then loop through the “Age” block once for each child.
Looping based on a Number
- In the Survey tab, click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
- Select the Loop based off of a question checkbox.
- Select the Text Entry question and choose Numeric Response. Then, specify the maximum number of loops you want to allow.
Qtip: We highly recommend adding a maximum number. This will keep your data file from getting too large.
- If desired, select Randomize loop order. See link for details.
Attention: You cannot export the loop order, so you won’t know what order respondents saw the loops. You will only know the answers they provided for each field.
- Click Save.
Static Loop & Merge
You can have the survey loop through the same options for each respondent by setting up static fields. Manually enter the fields that each respondent should loop through.
- In the Survey tab, click the block you want to repeat.
- Select Loop & merge.
- Click Turn on Loop & Merge.
- In Field 1 column, add a name for each of your loops. The number of rows in this column specifies how many loops you’ll have.
- Rows represent the number of loops. To add rows, click the last row. You can also name a row and press Enter on your keyboard.
- To remove rows, click the red minus sign ( – ) to the left of each row.
- To add or remove fields (columns), click the plus and minus buttons. For more information on how to use these fields, see Loop & Merge Fields.
- If desired, select Randomize loop order. See more at the linked section.
Attention: You cannot export the loop order, so you won’t know what order respondents saw the loops. You will only know the answers they provided for each field. - Click Save.
Loop & Merge Fields
Each time you turn on loop & merge, you create loop & merge fields. These fields are used to create dynamic text that is different for each loop. This can be helpful if you’re planning on piping in certain information for different loops.
Customizing Loop Fields
Each loop has its own set of fields. You can think of Field 1 as the “name” of the loop. You can populate Field 1 with answer choices from a previous question, or with manually entered text.
Example: In the image shown below, the fields are based off answers to a question. The first loop is Men’s Clothing, the second loop is Women’s Clothing, and so on.
After entering text in Field 1, you can create additional fields (columns) by clicking the plus ( + ) button. Click on the field you want to name and type text directly into the box. Continue adding and filling fields until you have all the fields you need. You can click the minus button ( – ) to remove fields.
Example: In the image below, the first loop of the survey will have:
- Field 1 = Men’s Clothing
- Field 2 = Shorts
In the second loop:
- Field 1 = Women’s Clothing
- Field 2 = Shorts
Using Loop Fields
Within the loop & merge block, you can use these fields to customize each loop with piped text. Piping in Field 1 will display the Field 1 text for the loop, and piping in Field 2 will display the Field 2 text.
When a respondent is in the Women’s Clothing loop, the first question will read, “How often do you shop in the Women’s Clothing department?” The second question will read, “How often do you purchase Shorts?”
This is how the respondent will see Field 1 and Field 2 when they’re in the Women’s Clothing loop.
Randomizing Loop Order
Within a loop & merge block, you can display the loops in a randomized order and limit the number of loops that are displayed to each respondent.
To turn on loop randomization, select Randomize loop order. If you want to limit the number of random loops shown to each respondent, select Present only __ of total Loops and type a value into the text entry box.
Understanding Loop and Merge Data Exports
When viewing or exporting your data, each loop is treated as a separate set of questions with their own columns in the file. For example, if you have 5 possible loops of a block that has 3 questions, you’ll get 15 columns of data. Even if a respondent isn’t shown all of the loops, all possible loops have their own columns in the data export.
Loop & Merge Example Data
The question “How often do you shop in the ${lm://Field/1} department?” from our example survey will output raw data that will look similar to this in a CSV file:
You’ll notice that each column name starts with the departments we added in Field 1. In this image, we see the “Men’s clothing” results. (The other departments are repeated in this file, too. You can see the “women’s clothing” results on the right.)
Questions are also numbered according to fields. “Men’s clothing” is our first loop in Field 1, so its questions are numbered “1_Q#.” “Women’s clothing” is second, so its questions are numbered “2_Q#.”
However, other fields are not called out by name in the data, because they vary by loop. Instead, we see [Field-2] and [Field-3]. Open your loop and merge fields to match each field to a name.
Using Logic in Loop & Merge Blocks
In loop & merge blocks, you can base display logic off of which loop the respondent is currently in. You can use this feature to hide a question during certain loops.
This question will be displayed only during the Men’s Clothing loop.
For more information on how display logic based off loop and merge works, see the linked support page.
For more information on how display logic based on questions in a looped block works, see the linked section, Questions in Looped Blocks.
Turning Off Loop & Merge
You can deactivate the loop & merge settings on a block. Respondents who take your survey after the deactivation will move through the block only once (i.e., the block will behave normally).
Loop and Merge in Different Project Types
Depending on your license, you might have access to several project types. Loop and merge is only available in a few types of projects, including:
Loop and merge is not available in any Employee Experience projects.