Expressions let you perform calculations and apply logic in activity parameters. You can use math operations, conditions, dates, and text functions.
To create an expression, start the value with the equals sign =.
Examples:
=6^2 + {=Document:PROPERTY_NUM}/2
=if({Document:ID}=5, "text1", "text2")
You can use multiple calculations in one field and combine calculations with text.
Combine calculations with text
Option 1: Insert a calculation into text
Wrap the expression in {{=...}}.
Example
You need to execute the documents before {{=DateAdd({=Document:CREATED}, '5d')}}
Option 2: Join text and values
Use the & operator and place text in quotation marks.
Examples:
="Reply:" & (1+3)
="Author: " & {=Document:CREATED_BY} & ", Deadline: " & DateAdd({=Document:DATE_CREATE}, "1d")
Operators
Use operators to perform calculations or comparisons.
| Operator | Description |
|---|---|
+
|
Add values |
-
|
Subtract values |
*
|
Multiply values |
/
|
Divide values |
=
|
Equal |
<>
|
Not equal |
<
|
Less than |
>
|
Greater than |
<=
|
Less than or equal |
>=
|
Greater than or equal |
()
|
Group operations |
&
|
Combine text values String Operators |
^
|
Exponentiation |
%
|
Percentage |
true
|
Logical true |
false
|
Logical false |
and
|
Logical AND |
or
|
Logical OR |
not
|
Logical NOT |
Example:
=if(or({=Variable:aaa}>2, {=Variable:bbb}<10), "yes", "no") Calculation functions
Use functions to process numbers, text, dates, and arrays. Enter = in a field to see the list of available functions.
Functions and examples
| Function | Description |
|---|---|
abs
|
Returns the absolute value of a number. Works the same as the PHP abs() function. |
dateadd
|
Adds a specific amount of time to a date.
Syntax: Supported time units:
You can use upper or lower case. Examples:
=Dateadd({=Document:DATE_CREATE}, "-2d") =Dateadd({=Document:DATE_CREATE}, "2 days 3 minutes")
If the value is stored in a field, use the concatenation operator =DateAdd({=Document:DATE_CREATE}, {=Variable:WHAT2ADD} & "y 10h")
|
datediff
|
Returns the difference between two dates.
Syntax: You can specify the result format. Example:
=datediff({=Variable:Variable1}, {=Variable:Variable2},'%m month, %d days') |
date
|
Formats a date. Works the same as the PHP date() function.
Syntax: |
WorkDateAdd
|
Adds working time to a date based on your company calendar.
Syntax: Supported time units:
You can use upper or lower case.
Example:
=WorkDateAdd({=Template:Parameter1}, "2d") If Parameter1 is 28.04.2016 and April 30–May 1 are weekends, the result is: 02.05.2016 09:00:00.
Working days and hours are configured in Bitrix24 settings. |
AddWorkDays
|
Adds working days to a date.
Syntax: Examples:
|
isWorkDay
|
Checks whether a date is a working day.
Syntax: Example:
{{=if(isWorkDay({=Template:Parameter1}), "Yes", "No")}} If Parameter1 is 28.04.2016, the result is Yes because April 28 is a working day. |
isWorkTime
|
Checks whether a date and time fall within working hours.
Syntax: Example:
{{=if(isWorkTime({=Template:Parameter1}), "Yes", "No")}} If Parameter1 is 27.04.2016 15:00:00, the result is Yes because that time falls within working hours. |
toUserDate
|
Converts a date and time to the user's time zone.
Syntax: Parameters:
|
GetUserDateOffset
|
Returns the difference between the user's time zone and server time in seconds.
Syntax: Parameter:
|
getdocumenturl
|
Returns a link to the current document.
Syntax: Parameters: Link format
Full link
If set to Examples:
BBCode format:
HTML format with full domain: |
responsible
|
Returns a date or date and time in the assignee’s time zone. Supports Date and Date/Time fields.
Syntax: Example:
{{=Document:DEADLINE > responsible}} If the Deadline field contains 03/15/2026 10:00, the value is converted to the assignee’s time zone. Result: The date and time are displayed in the assignee’s local time. |
if
|
Returns one value if the condition is true and another if it is false.
Syntax: Example:
=if({=Variable:Variable1_printable}>0, "yes", "no")
You can compare values of different types, as long as they follow the supported type conversion rules.
If you pass a multiple field (array) to the Example:
{{=if({=Bind to user multiple}, "Empty", "Not empty")}} If the Bind to user multiple field is empty, the result is "Empty". If the field contains at least one value, the result is "Not empty". |
intval
|
Converts a value to an integer.
Example:
=intval("234j4hv5jhv43v53jk4vt5hj4") → 234 |
floatval
|
Converts a value to a decimal number.
|
numberformat
|
Formats numbers to make them easier to read.
Example: |
min
|
Returns the smallest value. |
max
|
Returns the largest value. |
rand
|
Returns a random number.
Syntax: The maximum value is optional. Example:
=rand(0,10) returns a random value between 0 and 10. |
round
|
Rounds a number.
Syntax: Examples:
|
ceil
|
Rounds a number up.
Example:
=ceil(5.5) → 6 |
floor
|
Rounds a number down.
Example:
=floor(5.5) → 5. |
substr
|
Returns part of a string. PHP substr() function
Syntax:
Indexing starts at 0. For example, in the string Example:
{{=substr("0123456789", 3, 4)}} → 3456If the expression contains an error, it is displayed as plain text. |
strpos
|
Returns the position of the first occurrence of a substring. |
strlen
|
Returns the length of a string. |
implode
|
Combines multiple values into one string using a custom separator. Works like PHP's implode().
Syntax: Parameters:
The function returns a single string with all values joined in the specified order. |
explode
|
Splits a string into multiple values. Works like PHP's explode().
Syntax: Parameters:
The function returns an array of values created from the original string. |
randstring
|
Returns a random string. |
merge
|
Combines arrays.
Syntax: Example:
=merge({=Document:FILES}, {=Variable:file}) |
urlencode
|
Encodes text for use in URLs. |
strtolower
|
Converts text to lowercase. |
strtoupper
|
Converts text to uppercase. |
ucwords
|
Capitalizes the first letter of each word. |
firstvalue
|
Returns the first value from a multiple field. |
swirl
|
Moves the first value in a multiple field to the end of the list. The values shift one position to the left, and the first value becomes the last. |
shuffle
|
Randomizes the order of values in a multiple field. Works like PHP's shuffle(). The function returns the same values in a random order.
You can use The workflow includes a multiple variable called Users, which stores a list of employees.
After the workflow runs, the task is assigned randomly to one user, and another user is added as a participant. |
settime
|
Sets a specific time for a date.
Syntax: Examples:
If the number of minutes exceeds 59, the function automatically converts the extra minutes into hours. |
trim
|
Removes spaces at the beginning and end of text.
Syntax:
Example: If |