Skip to main content
Loading...
Skip to article
  • Qualtrics Platform
    Qualtrics Platform
  • Customer Journey Optimizer
    Customer Journey Optimizer
  • XM Discover
    XM Discover
  • Qualtrics Social Connect
    Qualtrics Social Connect

Loop & Merge


Was this helpful?


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The feedback you submit here is used only to help improve this page.

That’s great! Thank you for your feedback!

Thank you for your feedback!


About Loop & Merge

Loop & merge allows you to take a block of questions and dynamically repeat them multiple times for a respondent.

Example: A clothing company wants to ask a set of questions about each of its clothing departments. Rather than taking the time to create new questions for men’s clothing, women’s clothing, and children’s clothing, the questions could be created once. Loop & merge could then automatically repeat the set of questions once for each clothing department the respondent indicated they visited.

A question about the departments people shop at where they can select multiple answers. Ina separate block marked 'Loop and Merge' below, a question about shopping frequency that can apply to any of the answers from question 1

For a quick example of what loop & merge can do, view our Loop & Merge Example Survey.

Warning: You cannot use loop & merge to go backwards in the survey. You can only use it to go forward in the survey, or to repeat a block over and over.

Turning on Loop & Merge

Qtip: Loop & merge is turned on and off for an entire block, so you’ll want to be sure that all of the questions you want to loop through are in one block.
Warning: Do not enable loop & merge on an existing question if you’ve already collected data, as you will lose already collected data. See Testing & Editing an Active Survey for more information.
  1. In the Survey tab, click the block you want to repeat.
    Block clicked; loop and merge option appears in editing pane to left
  2. Select Loop & merge.
  3. Click Turn on Loop & Merge.
    Blue Turn on Loop and Merge button in the upper-left

Once loop & merge is turned on, you can specify how your block of questions will be repeated. Choose to loop based on questions, numbers, or predetermined fields.

The next step is creating and understanding loop & merge fields.

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.

Each loop has its own set of fields. Field 1 is the “name” of the loop. You can populate Field 1 with answer choices from a previous question, or with manually entered text. Both of these options are described below.

Loop and Merge window with Field 1 column highlighted

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. To add or remove fields, click the plus and minus buttons.

Plus and minus signs to the right of the Field 2 column

To enter text in the additional fields for each loop, click on the field and type text directly into the box. Continue adding and filling fields until you have all the fields you need.

This loop and merge has 4 field columns (Field 1, Field 2, Field 3, Field 4)

In the first loop of this survey, Field 1 will be Men’s Clothing, Field 2 will be Shorts, and so on. In the second loop, Field 1 will be Women’s Clothing, Field 2 will be Shorts, and so on.

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.

Piped Text for Field 1 in the questions of the Loop and Merge block

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?”

An image of the same questions in a survey, where the Piped Text has transformed into looped fields

This is how the respondent will see the Field 1 and Field 2 when they’re in the Women’s Clothing loop.

Qtip: For more information on piping loop & merge fields into questions, view Piping Text from a Loop & Merge Field.

Automatically set Field 1 to the choices of an existing question

To make Field 1 equal to the answer choices of a question you created, select Loop based off of a question. You can then click on the corresponding fields to enter any text you want in Fields 2, 3, etc.

Loop based off a question is selected

To add or remove additional fields for each answer choice, click the plus ( + ) and minus ( – ) buttons.

Manually enter Field 1

To enter Field 1 manually, click directly on the field and enter text. Do the same for any text you want to have in other fields as well.

To add rows, enter a value in the last 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, click the plus ( + ) and minus ( ) buttons.

Minus signs to the right of the columns and to the left of rows

Qtip: If you know HTML, you can paste the HTML for an image into Field 1, then pipe Field 1 into the question for the image to be displayed to the respondent. Our support team does not offer assistance or consultation on custom coding, but you can always try asking our community of dedicated users instead.

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.

Example: You could ask your respondents which products they typically purchase and then ask them questions about each product.

Before setting up this loop & merge, you’ll need at least 2 question blocks in your survey. The first block should contain a question that will determine which loops to show to the respondent. The second block will be looped.

A question in the first block asks a multiple select question. The second block, which has loop and merge turned on, will loop based on this multiple select question.

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.

To loop based on a question

  1. Click the block you want to repeat.
    Block clicked; loop and merge option appears in editing pane to left
  2. Select Loop & merge.
  3. Click Turn on Loop & Merge.
    Blue Turn on Loop and Merge button in the upper-left
  4. Click the Loop based off of a question checkbox.
    Question selected to loop based off of. Randomize loop order selected. Save button in bottom-right of the Loop and Merge window

    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.
  5. Select the question with the information to be looped and choose which answer choices to loop through. The answer choice options will vary depending on the question type.
    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 or All Choices – Entered Text to see the typed answers when piping in fields.
  6. If desired, select the Randomize Loop Order checkbox. To limit the number of loops shown to each respondent,  select Present only [#] of total Loops.
    Qtip: Although you can export the responses given for each field, you cannot export the order in which the loops were presented to the respondents.
  7. 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.

Example: You can ask your respondents how many children they have, and then have them fill out a block of questions once for each child.

Before setting up this loop & merge, you’ll need at least 2 question blocks in your survey. The first block should contain a text entry question that will determine how many loops to show to the respondent. The second block will be looped.

Question that asks for a number, followed by a separate block that is looped

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.

To Loop based on a Number

  1. In the Survey tab, click  the block you want to repeat.
    Block clicked; loop and merge option appears in editing pane to left
  2. Select Loop & merge.
  3. Click Turn on Loop & Merge.
    Blue Turn on Loop and Merge button in the upper-left
  4. Select the Loop based off of a question checkbox.
    Loop based on a question is selected. The question where they enter numbers is selected. A field called Max Loops appeared. In this example, we typed in 5 for a maximum of 5 loops based on answers given to this question. Randomize loop order is not selected, but you can see the setting at the bottom of the window. Save on lower-right
  5. Select the Text Entry question and choose Numeric Response. Then, specify the maximum number of loops you want to allow.
  6. If desired, select the Randomize Loop Order checkbox. To limit the number of loops shown to each respondent, select Present only [#] of total loops. Additionally you can add extra information in the other columns of the Loop & Merge settings.
  7. Click Save.

Static Loop & Merge

You can have the survey loop the same for each respondent by setting up static fields. With static Loop & Merge, you can manually enter the fields that each respondent should loop through.

Example: Have all your respondents loop through a “Product Awareness” block once for each of your products.

Questions with Field Piped Text in them

To loop based on static fields

  1. In the Survey tab, click the block you want to repeat.
    Block clicked; loop and merge option appears in editing pane to left
  2. Select Loop & merge.
  3. Click Turn on Loop & Merge.
    Blue Turn on Loop and Merge button in the upper-left
  4. Type directly in the first Field 1 box to specify Field 1 for the first loop (by default, the survey will loop through this block once for each row containing a value in the Field 1 column).
    Field 1 column
  5. To add rows, click the last row. To remove rows, click the red minus sign to the left of each row. To add or remove fields, click the plus and minus buttons. For more information on editing and piping text from Fields, see Loop & Merge Fields.
  6. If desired, select the Randomize Loop Order checkbox. This will randomize the order the loops are shown to your respondents. To limit the number of loops shown to each respondent, select Present only [#] of total loops.
    Randomize loop order is selected and so is Present only X number of total Loops
  7. Click Save.
    Save button on lower-right

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.

After setting loop & merge on a block, you can access loop randomization settings by clicking the loop & merge icon at the top of the block.

Loop & merge icon in upper-right of block

This opens the Loop & Merge dialog box. To turn on loop randomization, select the Randomize Loop Order checkbox. If you want to limit the number of loops shown to each respondent, select Present only __ of total Loops and type a value into the text entry box.

Present only X of total Loops is filled out

Viewing Loop Order in Your Data

When viewing your data, each loop is treated as a separate set of questions. If you have 5 possible loops, you will see the looped questions repeated 5 times in the data. Even if a respondent isn’t shown all of the loops, all possible loops will be represented in the data.

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:

CSV of lopped data

The question “How often do you shop in the [Field-1] department?” is repeated 5 times in the data, once for each loop. Any question in the looped block will get a column for each choice in the question it’s looping off, to represent how many times it could’ve been repeated.

[Field-1] will appear in the column title – not the field that was piped in. Use the order of the choices in the original question to determine which column belongs to which choice. For example, if in the first question “Men’s Clothing” is the first choice, the 1_Q9 column is then the data for the loop asking about Men’s Clothing.

Qtip: This is the case for randomized loop data, too. Data from the choices is recorded in the original order. However, 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.

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.

Logic that says if Loop and Merge, specific Field 1, is Current Loop

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, towards the bottom.

Turning Off Loop & Merge

Turning off loop & merge will deactivate the loop & merge settings on a block. Respondents who take your survey after the deactivation will move through the block only once (e.g., the block will behave normally).

Warning: If you turn off loop & merge after having collected data, you will lose the associated loop data in your Data & Analysis tab. See Testing & Editing an Active Survey.
Warning: Be sure to update or correct any piped text or display logic that might be based on loops or fields!

To turn off Loop & Merge

  1. In the Survey tab, locate the block for which you want to turn off loop & merge.
  2. Click the loop & merge icon on the block.
    Loop & merge icon in upper-right of block
  3. Click Turn Off Loop & Merge.
    Turn Off Loop and Merge button in upper-left

Loop and Merge in Different 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.

FAQs