When creating a questionnaire, the content of an invitation to complete the survey or an e-mail sent after completion using the Startquestion tool, it is possible to change the automatically created content or information into more personalised messages. Startquestion also allows you to set different content of messages, which can be displayed depending on the answers given by the respondents.

In order to enter such personalised information, please use the Dynamic Content (macros) function. In the article in the Startquestion guide you can find information about the available macros, where they are available and how to use them. This post will focus on one of the macros - extended ANS_.

How to insert dynamic content using the ANS_ macro?

Dynamic content can be inserted very easily. There are two ways: by using the content editor and selecting the correct item from the "Tags" drop-down menu.

Another way is to enter the macros name directly into the content, for example, [ANS_ID_12998] or [ANS_ID_1233.1]. This option is especially useful when in a given place (where we want to insert macros) it is not possible to edit the content in advance (fr example, the content of the question).

With the help of the ANS_ macro, it is possible to dynamically insert the content of the question, the content of the answer provided on the previous page or the content of the message of the responses provided by the respondent in the completed survey. Currently, the ANS_ macro is available for the following question types: single-choice, multiple-choice, form, drop-down, open, form, e-mail question, number and date.

The ANS_ macro should be inserted using the drop-down list in: the "Dynamic content" in the advanced editor (it is shown in the graphic above).

Attention: please note that the ANS_ID_ * macros do not work in the widget. In the case of a widget, the working macros are the older macro implementation, for example, [ANS_*no*], where no is the question number.

What you can use the ANS_ - use case macros for

Depending on the type of the macro:

  • ANS_* - allows you to set the selected answer to the content of the questions, answers, alerts or reports.

  • ANSC _* - as mentioned above, but in the case of a multiple-choice question, the answers are separated by a vertical bar "|" instead of a comma.

  • ANSH_* - performs the same functions as the two mentioned above, but in this case multiple-choice questions are answered with a newline (<br>).

  • ANSX_* - allows you to insert responses to a Webhook alert and set a redirection to a URL after completing the survey. The macro substitutes the answer without Polish characters, spaces are replaced by underscores (_).

  • ANSU_* - as the mentioned above, but additionally the response is passed through the urlencode function - the preparation for sending the response as a GET parameter in the URL address.

Did this answer your question?