Language Expressions
The language containing operators and functions is used for configuring default values, validation rules, and visibility of fields and properties.
The "Default Values", "Validation Rules", and "Visibility" fields of Visual Form Editor only work with an enumeration property's index and not its actual value. You cannot use the value in functions such as if, concat, or in various operators. If feasible, you can try setting the same string for both, the value and index for the properties you must use in the "Default Values", "Validation Rules", and "Visibility" fields.
Argument | Description | Usage Pattern | Use in | ||
---|---|---|---|---|---|
Default rules | Validation rules | Visibility | |||
Variables, entities, and properties | |||||
this | Value of current element | this > 100 | No | Yes | No |
entity.property entity.`label` | Value of property of entity. Use for wrapping labels with spaces. | activity.aworktype = 1 | Yes | Yes | Yes |
White spaces and comments | |||||
[space], [tab], [line break] | Assuming multiple white spaces as single space. Assuming white space as separator. | this + 100 | Yes | Yes | Yes |
/* Any comment */ | Assuming comment block as single white space. | activity.PROP_A1 > 77 /* 77 - is predefined parameter */ | Yes | Yes | Yes |
Logical operators (case sensitive, operands will be converted to Boolean) | |||||
OR | Logical disjunction | a OR b | Yes | Yes | Yes |
AND | Logical conjunction | a AND b | Yes | Yes | Yes |
Unary operators | |||||
NOT | Logical not (operand will be converted to Boolean) | NOT (a AND b) | Yes | Yes | Yes |
— | Arithmetic inversion (operand will be converted to Number) | - activity.PROP_A1 this * (- activity.PROP_A2) |
Yes | Yes | Yes |
Equal Comparison Operators (case sensitive for Strings). Operands will be converted to String | |||||
= | Equal to | a = b | Yes | Yes | Yes |
<> | Not equal | a <> b | Yes | Yes | Yes |
Comparison Operators (case sensitive for Strings). Lexicographic ordering is used to compare strings.Use toNumber() for arguments if number comparison is needed. | |||||
< | Less than | a < b | Yes | Yes | Yes |
> | Greater than | a > b | Yes | Yes | Yes |
<= | Less than or equal to | a <= b | Yes | Yes | Yes |
>= | Greater than or equal to | a >= b | Yes | Yes | Yes |
Arithmetic Operators (all operands will be converted to Number, any arithmetic operation with Infinity/NaN returns Infinity/NaN) | |||||
+ | Addition | a + b | Yes | Yes | Yes |
- | Subtraction | a — b | Yes | Yes | Yes |
* | Multiplication | a * b | Yes | Yes | Yes |
/ | Division Division by zero: Division by zero returns infinity, which will be converted to "" (empty string). |
a / b | Yes | Yes | Yes |
Additional Operators (case sensitive) | |||||
string CONTAINS needle | Return true if `string` contains `needle` (operands will be converted to String) | this CONTAINS "A0" activity.PROP_A1 CONTAINS concat("-", this) NOT activity.PROP_A2 CONTAINS activity.PROP_A3 |
Yes | Yes | Yes |
value IN (value1[, value2, [, valueN]]) maximum 1000 arguments | Returns true if `value` is equal to any `value1`...`valueN` (value will be converted to String) | this IN (1, 2, 3, 4) activity.PROP_A1 IN ("value1", "value2") NOT activity.PROP_A2 IN ("value1") |
Yes | Yes | Yes |
value BETWEEN (min, max) | Returns true if `value` is equal to `min`, equal to `max` or between them. The same as: value >= min AND value <= max (operands will be converted to Number) | 1 BETWEEN (0, 100) NOT 200 BETWEEN (99, 100) |
Yes | Yes | Yes |
Functions (case sensitive) | |||||
if(condition, value1, value2) | Function which returns value1 argument if condition is true and value2 argument if condition is false (condition will be converted to Boolean) | if(activity.PROP_A1 > 0, 1, 0) | Yes | No | No |
now(string) | Returns current date in required format. View corresponding section for details | now("yyyy-MM-dd HH:mm:ss") | Yes | No | No |
toNumber(value) | Formatting object to required number format | toNumber(activity.PROP_A1) toNumber("123.45") |
Yes | Yes | Yes |
toString(value) | Formatting object to string | toString(activity.PROP_A1) toString(123.45) |
Yes | Yes | Yes |
concat(string1, string2 [... ,stringN]]) maximum 20 arguments | Concatenate strings (all operands will be converted to String) | concat(this, "#", activity.PROP_A1) | Yes | Yes | Yes |
toLowerCase(string) | String to lower case (operand will be converted to String) | toLowerCase(activity.PROP_A1) | Yes | Yes | Yes |
toUpperCase(string) | String to upper case (operand will be converted to String) | toUpperCase(activity.PROP_A1) | Yes | Yes | Yes |
empty(value) | Returns true if `value` is undefined or empty string or NaN or Boolean, false in all other cases | empty(activity.PROP_A1) NOT empty(activity.PROP_A2) |
Yes | Yes | Yes |