Skip to main content
  • Customer Experience
    Customer Experience
  • Employee Experience
    Employee Experience
  • Brand Experience
    Brand Experience
  • Product Experience
    Product Experience
  • Core XM
    Core XM
  • Design XM
    Design XM

Piped Text

What's on This Page:

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 Piped Text

With piped text, you can customize question and answer choice wording for each respondent, allowing each of them to have a customized, dynamic, and personal survey experience. Piped text is a line of code you add to your survey that pulls information from different sources and displays that information to the respondent (or can be used in display logic, embedded data, and other areas).

Example: After asking about a respondent’s preferred product, you can pull their selected answer into a follow up question and have it displayed in the question text.

Though piped text appears as a line of code in your survey editor, when respondents take the survey, this code will be replaced with the specified content.

A question asks what software you use. After a page break, the second says You selected and has a placeholder that starts with French brackets

The same You selected question, but in an active survey, where the bracket placeholder (piped text) is replaced with the answer the respondent gave to the previous question

Qtip: Want to watch a video on how to use piped text? Visit Configuring Your Project on XM Basecamp for a guided learning experience. Access is included as part of your Qualtrics account.

Accessing the Piped Text Menu

Piped text is generated using the Piped Text menu. This menu is found in many different places throughout Qualtrics.

  • Questions: Click the question text and click the blue Piped Text button.
    When you click to edit the text of a question, the Piped Text button appears on the upper left
  • Answer Choices: Click the answer choice text, then click the blue dropdown menu and select Insert Piped Text.
    When you edit the text of a choice and click the blue dropdown arrow, the Insert Piped Text option appears in the menu
  • Rich Content Editor: Click the {A} icon in the rich content editor located in many places throughout Qualtrics, such as when editing a question, writing an email, or creating other survey messages.
    After clicking on the question text, the Rich Content Editor button appears in the upper leftWhen you are in the Rich Content Editor, the button that looks like an A in fancy brackets (first button)
  • Embedded Data: When adding embedded data to the survey flow, click Set a Value Now, then click the blue dropdown menu and select Insert Piped Text.
    When you edit the value in an embedded data element, the blue dropdown arrow leads to an Insert Piped Text option
Qtip: If you’d like to use piped text in an area that does not have the piped text menu, simply generate the piped text in one of the above areas and then copy and paste the code into the desired location. For example, while you may need to set custom validation equal to a piped text value, you will need to generate this piped text in another location.

Generating Piped Text

  1. In the Piped Text menu, choose which type of piped text you want and specify the particular item you would like to insert.
    The Piped Text menu is expanded

    We are pulling information about the product category the respondent indicated they use most frequently. To get there, we chose the Survey Question option, selected the desired question, and finally chose the type of information to pipe in.
  2. Notice that the piped text is inserted into your survey, as signified by a code surrounded by a dollar sign and brackets.
    Piped Text inserted into a question
  3. Place the piped text where you want the actual text to appear in the question.
    Piped text moved to where it grammatically belongs in the question
Qtip: Using the rich content editor, you can style the piped text code with all the options available for regular text, such as bolding and italicizing.

Piping from a Previous Question

The Survey Question category in the piped text list allows you to pipe information such as the question’s text, a selected answer choice, and more.

Survey Question Piped Text menu shows a list of questions in the same survey

Attention: A question must be submitted by the respondent using the next button before piped text will work. If you pipe in the selected answer from one question to another, there must be a page break in between the two questions for the Piped Text to load.
Two questions with a page break between them, which looks like a dotted line with the label Page Break

To generate Piped Text from a question

  1. Open the Piped Text menu.Survey Question is selected form the piped text menu, revealing multiple choice options in addition to others
  2. Select Survey Question.
  3. Select the question to pipe from.
  4. Select the specific content from the question that you would like to pipe. We’ll go into detail on what each of these selections means below.
Qtip: When inserted into your survey, the piped text will be in the general format: ${q://QIDX/SelectedValue}. The field “QIDX” is the internal question ID for the selected question and should not be edited. Editing the question ID will cause the piped text to stop working.

Possible Values for Text Piped from a Question

In step 4 of the above example, you’ll notice a number of possible values that can be piped into your survey.

Qtip: When generating piped text for matrix tables, “Answers” refer to scale points and “Choices” refer to statements.
  • Question Text: Pipes the question a respondent sees when taking the survey.
  • Description: Refers to previous answer choice text. For example, if they select “Less than 1 month – Description,” the piped text would bring in “Less than 1 month.”
  • Text Entry: Pipes any text a respondent enters. For example, if your respondent picks “Other” and types in “Three Years,” the “Other (Text Entry)” piped text would bring forward “Three Years.”
  • All Choices – Displayed & Hidden: Pipes in every single answer choice in the question.
  • Displayed Choices: Pipes in only the choices the respondent saw. See our page on adding display logic to answer choices for more information on hiding and revealing choices to respondents.
  • Not Displayed Choices: Pipes in only the choices the respondent didn’t see. See our page on adding display logic to answer choices for more information on hiding and revealing choices to respondents.
  • Selected Choices: Pipes in only the choices the respondent selected.
  • Unselected Choices: Pipes in all the choices the respondent didn’t select.
  • Selected Choices Recode: Pipes in the recode value assigned to any selected choice.
  • Entered Text: Pipes in the text that the respondent entered in an answer choice text box.
Qtip: There is one more option that is not in the piped text menu called Selected Choices Count, which shows the number of choices the respondent selected in a question where they can pick multiple answers. The format for the selected count piped text is ${q://QIDX/SelectedChoicesCount}. For example, if you want to show the number of selected answers for Q12, it’d be ${q://QID12/SelectedChoicesCount}. If Q12 is a matrix table and you want selected count for the second statement, the piped text is ${q://QID12/SelectedChoicesCount/2}. Since QID can differ from the question’s number (e.g., Q12), be careful to generate another line of piped text for that question to double-check the QID.

Piping from an Embedded Data Field

Embedded data fields allow you to store information about a respondent without actually asking a question, and that information can be piped into later sections of your survey or used in your data analyses.

Embedded Data element in the Survey Flow

To generate Piped Text from an Embedded Data field

  1. Open the Piped Text menu.Embedded Data piped text menu is open. Field with dropdown for selecting existing embedded data to insert
  2. Choose Embedded Data Field.
  3. Click the dropdown arrow to see a list of the embedded data saved in your survey flow.
  4. Select the embedded data you wish to insert.
  5. When finished, click Insert to generate the piped text.

The Importance of Survey Flow Order

Earlier, we mentioned that when you pipe text from a previous question into a following question, you need to be careful of the order content appears, and of page breaks. These same rules apply when working with embedded data.

When putting your embedded data element in the survey flow, think carefully about the order of elements. If your embedded data is not reliant on the respondent answering questions to determine a value, it’s generally best practice to make sure the embedded data is at the top of the survey flow, so it is saved before the respondent reaches any piped text you have displayed.


Embedded Data element at the top of the flow

If the embedded data is reliant on the respondent answering certain questions before it can generate a value (as with math operations), then those questions need to appear in a block before the embedded data is set in the survey flow, and the questions where the embedded data is piped in and displayed to respondents must appear after the embedded data element. You may need to move questions to new blocks to achieve this.


Embedded Data in between two blocks

A separation between two different blocks is automatically considered a page break.

For additional questions regarding embedded data, see Best Practices and Troubleshooting Embedded Data.

Piping from a GeoIP Location

By default, Qualtrics will record the IP address of the respondent as they enter the survey. Based on their recorded IP address, Qualtrics will calculate their geographical location down to the zip code.

Qtip: You can enable Anonymize Responses in the Survey Options to disable recording of the respondent’s IP address.

To generate Piped Text from a GeoIP Location


  1. Open the Piped Text menu.GeoIP Piped Text menu with postal code, city, state region, area code, country name, and country code options
  2. Select GeoIP Location.
  3. Select the desired location identifier.
Qtip: Country codes are 2-Letter acronyms for each country. They are derived from ISO ALPHA-2 Code, a list of which can be found here. (Note that Qualtrics does not own and is not responsible for maintaining the content on the linked website, and we are merely providing the link as is.)
Qtip: You may need to use external resources to interpret the state/region GeoIP values as their format depends on their origin country.

Piping from a Scoring Category

Qtip: Piped text is the most customizable way to display scores to respondents, but it is not the only way. See Displaying Scores to Respondents.

The scoring feature allows you to attach point values to each question answer. Qualtrics allows you to pipe in the following for each scoring category:

  • Score: Total score, or the sum of all points a respondent earned in this category.
  • Items: The number of scored items the respondent answered.
  • Weighted Mean: A mean that excludes blank or unanswered values. Good for comparing scoring categories that add up to different total points.
  • Weighted Standard Deviation: A standard deviation that ignores blank or unanswered values.
Qtip: Both the weighted mean and the weighted standard deviation are based on the number of points received per question, but they only use scored answer choices that were selected in the calculation. For example, on the weighted mean, if there are three questions in the survey and the participant answers only two of them, this is how their weighted mean would be calculated: (Score on the first question they answered + Score on the second question they answered) / 2

To generate Piped Text from a Scoring Category


  1. Open the Piped Text menu.Scoring piped text menu
  2. Select Scoring.
  3. Select the appropriate scoring category.
  4. Select the desired value.

Piping Date / Time

Through the date / time piped text, you can display the current date and time in your survey, as well as other dates. This is useful to display in event registration surveys as a time reference for your respondents.

The timezone of date / time piped text is based off the timezone set in your account when the response was submitted. If you adjust the timezone in your account after responses are submitted, the data collected will not change.

To generate Piped Text for Date / Time

  1. Open the Piped Text menu.Piped Text Date Time menu
  2. Select Date / Time.
  3. Select the desired format.
Qtip: You may use the Other Date piped text to display any date in relation to the current date. For example, if you choose to display tomorrow’s date, the piped text will look like ${date://OtherDate/PT/+1%20day}. If you change the number before the percent sign, you can choose to display any date. Changing the piped text to ${date://OtherDate/PT/+50%20day} will show the date 50 days after today. This also works with “negative” days. ${date://OtherDate/PT/-10%20day} will show the date ten days before today. If you want to change the time zone in your piped text, you can use ${date://OtherDate/G:i/+1%20hours} as a model. The “+1” will make the time 1 time zone later. The same thing can be done using a minus sign to display an earlier time.


You can change the language date / time piped text is recorded in. At the end of the piped text, but inside the last bracket, include a question mark ( ? ), the word locale, and set it equal to a language code of your choosing.


For example, ${date://CurrentDate/DM?locale=FR} would give you the current date in French.

Locale does not affect the timezone of the data recorded.

Piping from a Contact List Field

If you are sending your survey to a contact list (also sometimes known as a panel), you can pipe information from that contact list into your survey or email invitation. These fields include basic information like first name, last name, and email, as well as the specialty fields External Data Reference and Language.

Question with contact list piped text

Any custom fields you’ve added to the contact list beyond these standard fields are stored as embedded data and can be piped in using the steps described in the Piping from an Embedded Data Field section.

To generate Piped Text from a Contact List field


  1. Open the Piped Text menu.The piped text window is open and Panels Field is selected
  2. Select Panels Field.
  3. Select one of the standard contact list fields.

Piping from a Loop & Merge field

With loop & merge, you can repeat a series of questions for a respondent that asks about a different item each time. Piped text is critical for loop & merge so that the respondent knows which item they are responding about.

Loop & merge button in the top right of the question block

Using Piped Text, you can display three pieces of information about your loop & merge:

  • Field: Loop & merge fields.
  • Current Loop Number: Which loop the respondent is currently on.
  • Total Number of Loops: The total number of loops the respondent will need to complete.

To generate Piped Text from a Loop & Merge field

  1. Make sure loop & merge is turned on in the same block as the question. Visit the linked support page for more details on how to set this up.
  2. Navigate to your question and open the Piped Text menu.
    Loop and Merge piped text menu
  3. Select Loop & Merge.
  4. Hover over Loop & Merge Fields.
  5. Select the desired Loop & Merge Field.

Piping from a Quota

With quotas, you can make sure that you only gather the right amount of data required for your study. Using piped text, you can display three pieces of information about your quota:

  • Count: The current number of responses that have incremented your quota.
  • Has Not Been Met:  Whether the quota has not been met (returns a 1 if true).
  • Has Been Met: Whether the quota has been met (returns a 1 if true).

To generate Piped Text from a Quota

  1. Make sure you have at least one quota set up in your survey. Visit the linked support page for more details on how to set this up.
  2. Navigate to your question and open the Piped Text menu.Image of the piped text menu for quotas
  3. Select Quota.
  4. Choose the quota to pipe from.
  5. Select either the current quota count or whether the quota has been met or not.
Qtip: You can also perform math operations on your piped values (e.g., multiply, divide, add, subtract). For example, you can show the percentage of the quota that is filled, rather than the actual count of the quota.

Random Number Generator

Piped text can be used to generate and display a random number to each of your respondents. When in the survey editor, it will appear as a line of code just like all other piped text. The algorithm that Qualtrics uses for randomization is called the Mersenne Twister.

Attention: The method described here does not check against existing IDs. That means that there is a chance that more than one respondent can have the same ID. This is extremely rare, and the chances are decreased by making your IDs longer. For example, try to make IDs five to seven digits long instead of four or below. If you have programming knowledge, you can also build a custom web service element to check against IDs.

Random number generator piped text

When respondents take the survey, this code will be replaced with a random number.

In the active survey, the random number generator generates a random number

There are 3 types of random numbers that you can generate:

  • Random Integer: A random whole number.
  • Decimal: Float. A random number with 13 decimal places.
  • True/False: Boolean. A 0 or 1 selected at random.
Example: You can use the random number generator code to create a random number for your respondents to use as a coupon code or as an ID number.

To generate a random number


  1. Open the Piped Text menu.Random number generator piped text menu. Fields for minimum and maximum.
  2. Select Random Number.
  3. Select IntegerDecimal, or True/False.
  4. Enter a minimum.
  5. Enter a maximum.
  6. Click Insert.
Attention: Note that a number randomly generated this way will not automatically be saved in your data. To capture the random number in your data, you would need to set up an embedded data field in your survey flow where the value is set equal to the random number generator.
An embedded data element set equal to the random number generator piped text, effectively saving the number in Qualtrics
Then, return to your survey editor and pipe the embedded data into your question to display it to the respondent.
The Coupon Code embedded data in the piped text menu. This embedded data element will pull in the random ID saved in the embedded data.In the question editor, the piped text for the Embedded Data is inserted so the respondent sees the same random number that's saved with their response in the data set