Loading...
  • Customer Experience
    Customer Experience
  • Employee Experience
    Employee Experience
  • Brand Experience
    Brand Experience
  • Product Experience
    Product Experience
  • Core XM
    Core XM

Piped Text

What's on This Page:


Was this helpful?


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 then 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
  • 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
  • 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.
    When 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

Qtip: 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. Looks like a dotted line labeled "page break"

To generate Piped Text from a question

  1. Open the Piped Text menu.
  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.
    Survey Question is selected form the piped text menu, revealing multiple choice options in addition to others
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.
  • Undisplayed 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

Embedded Data piped text menu is open. Field with dropdown for selecting existing embedded data to insert

  1. Open the Piped Text menu.
  2. Choose Embedded Data.
  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.

Example:

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.

Example:

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

GeoIP Piped Text menu with postal code, city, state region, area code, country name, and country code options

  1. Open the Piped Text menu.
  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

Scoring piped text menu

  1. Open the 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.
  2. Select Date / Time.
  3. Select the desired format.
    Piped Text Date Time menu
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.

Locale

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.

?locale=EN

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

the piped text window is open and Panels Field is selected

  1. Open the Piped Text menu.
  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 and Merge Field 1 piped text in a question

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. 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.
  3. Select Quota.
  4. Choose the Quota to pipe from and select either the current Quota count or whether the Quota has been met or not.
    image of the piped text menu for quotas
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

Random number generator piped text menu. Fields for minimum and maximum.

  1. Open the Piped Text menu.
  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.
And 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.
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

FAQs