Expressions are evaluated by the workflow engine and the output is used at the time of execution.
You can use expressions for any input field in the workflow editor.
You can use the basic arithmetic operators +
, -
, *
, /
and %
(modulo) in expressions.
25 / (3 + 2)
The devision operator /
will always return a floating point number. If you want to get a floored integer, use the //
operator.
31 // 5
The comparison operators ==
, !=
, <
, <=
, >
, >=
can be used to compare values.
5 > 3
The logical operators and
, or
and not
can be used to combine multiple expressions.
5 > 3 and 3 > 1
You can use variables in expressions, by referring to their names.
(var1 + var2) == 5
You can access properties of objects by using the dot or bracket notation.
object.property
object["property"]
You can access items of arrays by using the bracket notation.
array[0]
Convert values from one data type to another.
Function | Description | Example |
---|---|---|
double | Accepts an attribute of type string or integer and returns a double. | double("5") |
int | Accepts an attribute of type string or double and returns an integer. | int("5") |
string | Accepts an attribute of type integer, double, or boolean and returns a string. | string(5) |
Operate on lists, maps, and strings.
Function | Description | Example |
---|---|---|
in | Checks whether a given key is present in a list or map. | "Foo" in ["Foo", "Bar"] |
keys | Accepts an attribute of type map and returns a list of key elements in the map. | keys({"Foo": "Bar"}) |
len | Accepts an attribute of type list, map, or string and returns its length. | len("Foo") |
Support conditions within expressions.
Function | Description | Example |
---|---|---|
if | Accepts a boolean expression and returns the first value if true, else null. | if(5 > 3, "Foo", "Bar") |
default | Accepts a value and returns it if it is not null, else returns the default value. | default("Foo", "Bar") |
Check the type of an attribute.
Function | Description | Example |
---|---|---|
get_type | Accepts an attribute and returns its type. | get_type("Foo") |