Attribute - Expressions: Required, Enabled, Visibility
The examples are split by attribute types which are under comparison inside the syntax of expression, but not depending on the type of the attribute for which the expression is used. You can navigate by type on the right panel -> , in the section 'ON THIS PAGE'. By selecting appropriate type you will jump into conditional expressions examples, which are relevant for the types of the arguments which you are using for comparison.
All the above expressions should return true or false. For true returned result, the condition defined in expression is passed, and then the attribute turns into expected behavior: requirement to be filled in or enabling it on the form, or displaying it on the form.
Number
Convert Text to Number and compare
// stringText is key for Text type attribute
// first, Text type is converted to Number type in order to perform comparison
// numberCalc is key for Number type attribute
(Number('${stringText}') > ${numberCalc})
When used as visibility expression, attribute for which it is used will be visible in the case after the conversion text value of stringText is greater than number Calc.
Select
In similar manner for Typehead and Dropdown.
Visible if 1 of 3 values in Select type is picked - As Visibility expression
var leaveType = ${leaveType.id};
if (!leaveType) return false;
return ((leaveType === 'iK5dbLDQU69DTdISLKsF') || (leaveType === 'cylo8B4LEKHs9IOdb4nr') || (leaveType === '0SUjQwAsguWPQo5hZRu0'));
Darbo valandos - this leave type is marked with id : iK5dbLDQU69DTdISLKsF (1 of the 3 matching values). Visibility was setup for Name attribute:
-3c4d8974d7c615486dda5d00a2c6c469.png)
-2d63fa0973ff6e119099eebead97f5f5.png)
Text
Convert Text to Number and compare
// stringText is key for Text type attribute
// first, Text type is converted to Number type in order to perform comparison
// numberCalc is key for Number type attribute
(Number('${stringText}') > ${numberCalc})
Other
Comparison operators
=== equal
!== not equal
=< equal or less
=> equal or more
> more
< less
Please find the more detailed operator description: