How to write advanced triggers for your surveys
- Customer Success Team
- Dec 11, 2025
- 3 min read
Updated: Dec 16, 2025
Expressions
In the publish settings of the survey you can write a logical expression that must evaluate to true for the survey to be shown.
Values to be evaluated can be either a Number, String or Boolean. A number may be floating point or integer. Arrays or objects containing these types is also supported. The properties of an object can be accessed using the dot operator, and properties of an array by the in operator.
Values | Description |
43, -1.234 | Number |
"hello" | String |
true, false | Boolean |
" \" \\ " | Escaping of double-quotes and backslash in string |
foo, a.b.c, 'foo-bar' | External data, see next section |
Note! Strings must be double-quoted! Single quotes are for external variables.
Numeric arithmetic | Description |
x + y | Add |
x - y | Subtract |
x * y | Multiply |
x / y | Divide |
x ^ y | Power |
x mod y | Modulo |
Note! Modulo always returns a positive number: -1 mod 3 == 2.
Comparisons | Description |
x == y | Equals |
x != y | Does not equal |
x < y | Less than |
x <= y | Less than or equal to |
x > y | Greater than |
x >= y | Greater than or equal to |
x == y <= z | Chained relation, equivalent to (x == y and y <= z) |
x ~= y | Regular expression match |
x in (a, b, c) | Equivalent to (x == a or x == b or x == c) |
x not in (a, b, c) | Equivalent to (x != a and x != b and x != c) |
Boolean logic | Description |
x or y | Boolean or |
x and y | Boolean and |
not x | Boolean not |
if x then y else z | If boolean x is true, return value y, else return z |
( x ) | Explicit operator precedence |
Objects and arrays | Description |
(a, b, c) | Array |
a in b | Array a is a subset of array b |
x of y | Property x of object y |
Functions | Description |
abs(x) | Absolute value |
ceil(x) | Round floating point up |
empty(x) | True if x is undefined, null, an empty array or an empty string |
exists(x) | True unless x is undefined or null |
floor(x) | Round floating point down |
log(x) | Natural logarithm |
log2(x) | Logarithm base two |
log10(x) | Logarithm base ten |
max(a, b, c...) | Max value (variable length of args) |
min(a, b, c...) | Min value (variable length of args) |
round(x) | Round floating point |
sqrt(x) | Square root |
inArray(array, value, prop) | Value exists in array. Use prop to check for a property value of the item in the array, dot notation is supported. |
visitedUrl(url) | Given url has been visited on any visit, regular expression is supported. |
visitedUrlThisSession(url) | Given url has been visited this session, regular expression is supported. |
External data
The external data available at the time of evaluation. The best way to examine what data is available is using the JavaScript console on the website where the script is running. To examine the variable data you can inspect extellio.data in the JavaScript console. All distributions is located in extellio.data.dists
Name | Description |
window | The global window object in the browser. This contains global variables, browser information etc. |
distribution | Information about the survey that is being evaluated. |
data | All surveys and websites related to Extellio and the current script being used. |
Examples
Triggered when survey is in the same language code as the browser language.
window.navigator.language == distribution.surveyLanguageTriggered when my global variable loggedIn is true and the device type is DESKTOP
window.loggedIn and "DESKTOP" in distribution.deviceTypes Triggered when a page has been visited during this visits.
visitedUrlThisSession("/about")