Functions are small autonomous programs that "take in" some data as parameters, process it and return a resulting value. You can use functions to compute values of the variables or to condition bot answers to create complex dialogue flows. Here you can find a reference of currently supported functions with examples for the use in conditions.
length($string$)
Returns the length of the given $string$.
the condition checks whether $pw$ consists of exactly 8 characters
substr ($string$, $start$, $length$)
Returns the part of a string $string$ defined by $start$ (integer) and $length (integer) parameters. $string$ can be of type "text", "word" or "number".
substr ($profile_number$, 0, 2) == "49"checks if a user’s profile number starts with "49"
round($number$, $precision$)
Returns the rounded value of $number$ to specified $precision$ (number of digits after the decimal point). $precision$ can also be negative or zero (default). If $precision$ is negative the rounding will occur before the decimal point.
checks whether rounded $age$ equals or is greater than 18
floor($number$)
Returns the next lowest integer value by rounding down $number$ if necessary.
the compound condition checks whether $number$ is an integer
ceil($number$)
Returns the next highest integer value by rounding up $number$.
checks if $number$ rounded up is 1
abs($number$)
Returns the absolute value of $number$.
checks if absolute value of $number$ is smaller than 10
in_array($string$,$array$)
Checks if $string$ is an element of the collection $array$ and returns 1 if true.
in_array ("red", $preferred_colors$)checks if colour “red“ is saved in the collection $favourite_colors$
preg_match("/$pattern$/", $string$)
Searches $string$ for a match to the regular expression $pattern$. Returns 1 in case of a match and 0 in case of no match. Please make sure to embed the regular expression in "/ and /" ("/$pattern$/").
preg_match("/^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_\-\.]+\.[a-zA-Z]{2,5}$/", $email$) == 1checks whether $email$ has a valid format
now()
Returns current Unix Timestamp (number of seconds from 01. January 1970 00:00:00 UTC)
checks if the timestamp of NOW is smaller than (the timestamp of) 11/06/2018 5:50pm (UTC)
today()
Returns Unix timestamp of 0 a.m. of today’s date in the channel time zone (defined in channel settings) in seconds. A comparison with a date in the format DD.MM.YYYY or MM/DD/YYY is allowed in conditions.
checks if it is 01.01.2026
now() – today ()
Returns current time in the channel timezone in seconds.
checks whether it is forenoon (12 hours in seconds = 43200)
to_seconds($time$)
transforms $time$ inputted as hh:mm to seconds.
now()-today() < to_seconds("12:00")checks whether it is forenoon
yesterday()
Returns timestamp of yesterday at the same time (computed as now() – 24*3600). A comparison with a date in the format DD.MM.YYYY or MM/DD/YYY is allowed in conditions.
checks whether yesterday’s date was 31.12.2025
tomorrow()
Returns timestamp of tomorrow at the same time (computed as now() + 24*3600). A comparison with a date in the format DD.MM.YYYY or MM/DD/YYY is allowed in conditions.
checks tomorrow is 02.01.2025
weekday()
returns current weekday (1-7 for Monday-Sunday)
checks it if is Sunday today
month()
returns current month
checks if it is June
day()
Returns current day of the month
compound conditions checks if it is 20th June.
unix_timestamp(time)
The function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC)
time_format($format$, $timestamp$)
Returns time formatted according to the string in $format$ using the given integer $timestamp$ or the current time if no timestamp is given.
The followings characters are recognized in the format parameter string:
$time=(time_format("H:i"))$ here current time is in a format hh:mm is passed to the variable $time$ (type "text").
Time_format() function is based on the php date() function. Please find its description and a comprehensive list of formatting options here.