Using custom properties and answers in question text (text piping)

Text piping is a term used for using answers given to a previous question in the text of a follow-up question. Besides a previous answer you can also insert the value of a custom property in question text.

In the survey editor, when you type a '@' in the input field for a survey question's text, a dialog pops up where you can configure the settings for the text that will be inserted at the current cursor position.

Using a custom property in a question's text

For website surveys a custom property must be set using Informizely's Javascript API. For example:

<script type="text/javascript">
    var IzWidget = IzWidget || {};
    IzWidget['insitez.ready'] = function (api) {
        api.set('custom', { 'name': 'John' });
    };
</script>

For link and email surveys custom properties can be passed as parameters to the survey URL. For example:

https://survey.informizely.com/2bd3p9NZAwEC?userId=45634&name=John

You can insert the value of a custom property by typing a '@' in the input field for a survey question's text, selecting the "Custom property" radio button and entering the name of the property.

Text Piping: property configuration

You can configure whether the option should be made lowercase or used "as is". Optionally, you can enter a default phrase that will be used when the custom property has not be set.

When you click "Save" you'll see a "property recall button" at the position where you typed the '@' to open the text recall dialog. Its text has the format "{{$property-name}}".

Text Piping: property recall

You can click the button to reconfigure the recalled text, or to remove it altogether (by clicking the "Remove" button in the dialog).

When the survey is displayed and the custom property has been set the property's value will be inserted in the question text.

Text Piping: property recall example

Using an answer to a previous question in a question's text

In the text recall dialog this option is only available when there are questions on a preceding page. You cannot recall answers to questions on the same survey page. Also, answer recall is currently not available for some question types, like 'matrix' and 'ranking'.

You can insert the answer to a previous question by typing a '@' in the input field for a survey question's text, selecting the corresponding radio button and selecting the question from the "Question" combobox.

Text Piping: answer configuration

You can configure whether the option should be made lowercase, which can be useful for answers to choice-type questions, or used "as is", for example when the answer is a name or free text. Optionally, you can enter a default phrase that will be used when the previous question is optional and has no answer.

When you click "Save" you'll see an "answer recall button" at the position where you typed the '@' to open the text recall dialog. Its text has the format "{{#question-id}}".

Text Piping: answer recall

You can click the button to reconfigure the recalled text, or to remove it altogether (by clicking the "Remove" button in the dialog).

When the survey is displayed the answer to the first question will be inserted in the text of the second question.

Text Piping: property recall example

You can use text piping also in the text of non-question items on a survey page, like buttons, link items, and fixed text.
For example:

Text Piping: answer recap

Note that the "{i}" and "{/i}" around the answer recall button "{{#4}}" makes the text italic in the survey widget:

Text Piping: property recap example

You may be wondering how to enter a '@' in a question's text. When you open the text recall dialog by typing a '@' and then close it without clicking "Save", a '@' will be entered at the cursor position.