Text Piping

The term ‘Text Piping’ refers to the ability to insert information into a section of your project, that has been collected by a previous question or external source. The majority of other form building providers only allow you to pipe text into a question. However, we have extended this service to enable text piping into an answer option.

Piping text into questions

There are numerous reasons you may want to pipe text into a question, from personalizing your project for each respondent, to creating a clear line of questioning.

I.e. If you ask your respondents what brand of soda they drink, you can ‘pipe’ the text from their answer choice into any following related question.

E.g.

Question 1: Which brand of soda do you prefer?

  • a) Coca-Cola
  • b) Fanta
  • c) Sprite
  • d) Pepsi

Question 2: What do you think of Pepsi?

If a respondent selected ‘Pepsi’, you may then ask them what they think of this brand. To personalize the follow-up question for this respondent, you would pipe the ‘Pepsi’ text from the answer field into the chosen question field.

Alternatively, you could use Text Piping to transfer a respondent’s name into a question to improve the relational/ engagement aspects of your project.

Piping text into answer options

You may also want to pipe text from a respondent’s previous answer selection into a follow-up question’s answer field.

E.g:

  1. What is the name of your Project Manager? -> Carol
  2. Who is your Office Manager? -> Brian
  3. If you had a complaint, who would you feel most comfortable talking to?

a) Carol

b) Brian

c) Neither Carol or Brian

d) Either, no preference

Several instances of Text Piping are occurring in the example above. ‘Carol’ and ‘Brian’, in (1.) and (2.), represent the answers given by respondents for the first two questions. These custom answers are then piped into (3.) as options (a.) and (b.).

You may notice that you are also able to pipe previous answers from both questions into the same answer option for a question, as illustrated by (c.).

This allows you to make your projects as relevant as possible to any respondents.

How do I use Text Piping?

You will need to create at least two questions for text Piping to work. The first question will provide the text to be ‘piped’ (which we will refer to as the Source Text), which can then be incorporated into the second (Target Text).

Click the text box of the question you wish to become the target text, and select ‘Pipe Text From’. You will then be presented with three options:

  1. A Question Answer
  2. API Data Fields
  3. Email Tracking Fields

A Question Answer

This option pipes text from a previous answer field in your survey to a question field of your choice. Once you have selected ‘A question answer’, you will be presented with a drop-down list of all your previous questions. The question you choose determines which answers can be piped into your new question.

Note: When you use Piping from one question to another on the same page, the source text won’t appear until data from the requested questions have been entered by the participant.

There are some question types that contain several sub-questions, such as a Matrix (Common Scale) or Text Box (Multiple). You will have access to a second drop-down menu if you choose to pipe from one of these, from which you can select your preferred sub-question.

A unique ID will then be inserted into your project, which represents the answer option that will be piped.

  • E.g. {{ question(345345).answer(2) }}

This formatting allows further questions to be inserted or reordered without breaking existing ‘pipes’. However, if you move a Text Piping optimized question out of the necessary sequence, the corresponding pipes will be broken.

  • E.g. If Question A is piping text to Question B, Question A will always have to appear BEFORE Question B.

Note: We’d recommend that you create and organize all your questions before incorporating Text Piping. This will make it easier to visualize where you’d like to pipe text from and to.

API Data Fields

This option allows you to pipe text from ‘Hidden Fields’ using a QueryString or JavaScript API.

These terms simply refer to the way of creating applications that access the features or data of other digital services. You would be using this component to retrieve relevant data on your respondents, from a source external to this site.

Step One: Defining your Data

Before you can incorporate this type of Text Piping, you will need to define what kind of data you want ‘passed in’ to your project. To do this you will need to insert the ‘Hidden Fields’ element, which you will find in the list of available question types in the project builder. Then input the names of your fields, and all data will be stored as a string.

Note: Field name must contain no spaces, and only ‘**-**‘ or ‘**_**’ as special characters.

Step Two: Passing the data in

There are two ways to ‘pass data in’ to your survey from an external source. The first of these is by using Querystring parameters, whilst the second employs the JavaScript API.

Querystring Parameters

This method requires you to have used the hyperlink launch option. For the data to be unique to each respondent, you would have to generate the link server side.

Below you will see an example of a standard survey link, without the Querystring parameters applied.

kwiksurveys(.)com/s/sUrVey1aUnchC0dE

Each of your parameter names needs to be prefixed with “**custom_**” in your hyperlink for this method to work. See the example below:

kwiksurveys(.)com/s/[email protected]&custom_first_name=Luke&custom_last_name=Smith

As you can see above, the ‘custom’ fields included in this Querystring are:

The first half of these parameters (everything before the “**=**”) dictates the type of information being passed in, whilst the second half provides the corresponding information.

Note: You will not need to add the “custom_” prefix to your parameter names you entered in the project builder in Step One.

JavaScript API

This method allows you to embed your project directly into your website. It’s a great alternative when standard embed button codes or placeholder codes do not fully suit your requirements.

Note: You will need a basic understanding of JavaScript to use this method.

Simply add a property called “custom” to the config object, this may contain a single level object of strings. Example below:

{ formId: "###", custom: { userId: "32453", firstName: "Luke", lastName: "Smith", email: "[email protected]" } }

For more information on how to employ JavaScript API, please refer to this article.

Step Three: Using the data in the live survey (optional)

The data stored by either of the above methods can be used in your live survey, through the ‘Hidden Fields’ element discussed in Step One.

Step Four: Passing the data out in a redirect URL (optional)

You can pass information back to your website for confirmation that a respondent has completed your survey/project. To do this, select your Exit Page in the project builder. You will see three options:

  • Standard (with advertising)
  • Design Custom Page
  • Redirect to Web Address

Select the ‘Redirect to Web Address’ option, and enter the URL of the site you wish respondents to be directed to in the space provided.

Below is an example of how you can customize this URL with a unique code, so your website records respondents being redirected.

https://mywebsite(.)com/confirmationpage?email=[custom_email]

The [custom_email] section will be replaced with the input email address in the QueryString parameters or JavaScript API call you passed earlier.

Email Tracking Fields

This option allows you to pipe information/ data from a list of contacts. It requires you to import contacts to your Address Book, and distribute your project using the email launch process (‘Send to your mail list’).

Note: We are now required by law to verify that any emails sent through this service have a valid reply address. You will be asked to provide a reply address for respondents before you can send your project to an email list. We will send you a verification email, through which the account will be approved by us.

There are four ‘Tracking Fields’ you will be able to choose from in the drop-down menu, which includes:

  • first_name: Inserts the first name of a contact into a field.
  • last_name: Enters the surname of a contact into a field.
  • email: Places the contacts email address into a field.
  • custom: Inserts any custom information you may have created into a field.

Once you have chosen one of these fields, one of the following unique IDs will be inserted, indicating that your Text Piping has been successful.

  • {{ tracking(first_name) }}
  • {{ tracking(last_name) }}
  • {{ tracking(email) }}
  • {{ tracking(custom) }}