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.
Attention: Because blocks filled with multiple questions are being repeated, loop & merge can add many columns to your data. The larger a data file gets, the less easy it is for you to analyze your data, and the longer it may take for data to export. To avoid this, try to keep your repeating blocks short, and only repeat them as needed.

 

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 a 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:

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.

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.

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.

Looping 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 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.
  6. 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.
  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. That way, you can customize the number of times each respondent loops through the same questions.

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.

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.

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

Looping 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.
    Qtip: We highly recommend adding a maximum number. This will keep your data file from getting too large.
  6. 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.
  7. 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.

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

Questions with Field Piped Text in them

  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. 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.
    Field 1 column
  5. 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.
  6. To remove rows, click the red minus sign ( ) to the left of each row.
  7. 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.
  8. If desired, select Randomize loop order. See more at the linked section.
    Randomize loop order is selected and so is Present only X number of total Loops

    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.
  9. Click Save.
    Save button on lower-right

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.

Example: You want feedback on a few departments in your store: Men’s, Women’s, and Children’s. You also want to ask about 3 products from each department, but these products vary. Loop and merge fields allow you to define the different product names that should be shown to each customer.

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.

Loop and Merge window with Field 1 column highlighted

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.

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

Qtip: If you’re looping based off question answers, you can add as many columns (fields) as you want, but you cannot add additional rows. If you manually enter fields, you can add additional rows and columns as needed.

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

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

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.

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 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.
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.

Randomizing Loop Order

Attention: You cannot export the order each loop was presented to each respondent. You will only know the answers respondents provided for each specific field.

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.

Present only X of total Loops is filled out

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:

file shows how loop data is denoted in second header of every column
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.

Example: In our field setup, field 2 is “shorts” for men’s clothing, and field 3 is “shirts.”
Qtip: For randomized loops, the data is also recorded in the original choice 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, 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).

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!
  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

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.

FAQs