Navigation

Validation, Conditions and Personalization in Surveys

In a survey, you can add validations and conditions to questions in order to use responses to improve navigation or publish a quiz that requires answer validation and score attribution.


Syntax

A condition or validation always uses the same syntax composed of the following elements:
(property operator value)
(Q1.C2.Checked == 1)

Parentheses allow you, just like in a mathematical formula, to group criteria. In the following example, the condition or validation would be applied if choice 1 (C1) or (||) choice 2 (C2) of question 1 (Q1) has been selected and question 2 (Q2) is completed.
(Q1.C1.Checked == 1 || Q1.C2.Checked == 1) && (Q2.isCompleted == 1)


Data Types

Comparison value formats
Boolean (true)true
Boolean (false)false
Text (general text format)"abc"
Text (date format)yyyy.mm.dd
Text (date and time format)yyyy.mm.dd hh:mm:ss
Numeric (integer format)12345
Numeric (decimal format)123.45
Boolean
To indicate that the property...use...
is trueproperty == true
is falseproperty == false
Text
To indicate that the property...use...
is empty (null)property is null
is not empty (not null)property is not null
is equal to abcproperty == "abc"
is not equal to abcproperty != "abc"
contains abcproperty contains "abc"
does not contain abcproperty not contains "abc"
matches abc% (with wildcards)property like "abc%"
does not match abc% (with wildcards)property not like "abc%"
Numeric
To indicate that the property...use...
is less thanproperty < "123"
is less than or equal toproperty <= "123"
is greater thanproperty > "123"
is greater than or equal toproperty >= "123"
Possible combinations
To...use...
property1 and property2property1 && property2
property1 or property2property1 || property2
property1 added to property2property1 + property2
property1 added to valueproperty1 + "123"
property1 subtracted from property2property1 - property2
property1 subtracted from valueproperty1 - "123"
property1 multiplied by property2property1 * property2
property1 multiplied by valueproperty1 * "123"
property1 divided by property2property1/property2
property1 divided by valueproperty1/"123"
property1 and property2 or property3(property1 && property2) || property3

Validation Formulas and Conditions

Question (general)
PropertyDescription
Qx.Error
Boolean
Indicates whether the question contains an error.
Qx.isCompleted
Boolean
Indicates whether the question has been completed.
Text question or rating scale
(radio buttons)
PropertyDescription
Qx.Label
Text
The label (text) of the question.
Qx.Value
Text or Numeric
The value of the question.
Single choice question
(dropdown or radio button)
PropertyDescription
Qx.LabelThe label (text) of the question.
Qx.ValueThe value of the question.
Qx.Cy.LabelThe label of choice number "y".
Qx.Cy.Selected
Boolean
Choice number "y" has been selected.
Qx.Cy.ValueThe value of choice number "y".
Multiple choice question
(checkboxes)
PropertyDescription
Qx.LabelThe label (text) of the question.
Qx.ValueThe value of the question.
Qx.CountThe number of selected choices.
Qx.Cy.CheckedChoice "y" has been checked.
Qx.Cy.ValueThe value of choice number "y".
Qx.Cy.LabelThe label of choice "y".

Personalization (Piping)

Piping allows you to personalize the text of a question, a choice, or a row using the value of a previous response. For this to work, the reference must be on a page that comes before the page where the personalization element is used.

It can be used for: Question (Q), Validator (V), Page (P), and Parameter (E).

The syntax is as follows: [[P(Property)]]

Example to display the value entered in question 1
You answered “[[P(Q1.Value)]]” to a previous question. Please indicate why.
Properties
CheckedIndicates whether a choice is selected. Applies to single or multiple choice questions. The command must contain the choice identifier.
Example: Q1.C1.Checked
CountIndicates the number of checked boxes. Can apply to a row, a choice, or the entire question. Mostly used for multiple choice questions.
Example: Q1.R1.Count returns the number of checked boxes on row 1.
ErrorIndicates whether a question contains an error (not useful in piping but useful elsewhere in the syntax).
isCompletedIndicates whether a question has been completed.
isTrueIndicates whether a validator evaluates to true.
LabelThe label of the selected choice.
SelectedSame as Checked, but adapted for dropdown lists.
ValueThe selected or entered value.
TextThe question text.
DescriptionAdditional description of the question.
HelpTextThe help text of the question.
isNAFor scale questions, indicates whether the “Not Available” option is selected. Note that isNA does not return a default value.

Parameters

Parameters allow you to collect additional information about a respondent by passing information through the URL for a public/private survey, or transparently for a Dialog Insight Contact invitation survey. You can use parameters in question conditions.

Syntax: [[P(E1.Value)]], [[P(E2.Value)]]

E1 is the first parameter in display order in the Parameters tab.

The collected data will appear in the exported data. Columns in the file will correspond to each parameter (E1, E2, E3, etc.).

Example: E1.Value == 'Director' || E1.Value == 'President'

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.