Expressions are simply put a unit of code that results in a value.
Apex Forms Designer has a powerful expression builder that allows the user to create and use expressions that can be used in form or section validations and can be simple to complex conditions based on the business needs. The user also has the power to create custom functions as needed and then use them when building these expressions. Expressions are supported in some of the property fields (eg. Read Only If, Hide If, etc) and action fields (eg. Load Actions etc).
To add an expression, simply click in one of the property fields (under the 'Logic' tab of the Properties dialog) that supports expressions and that will pop up a configuration dialog, where you can author your expression.
User will give you access to all the context variables as you build the expressions. Below is a simple expression that evaluates to true if the 'member status' is 'Platinum'.
Click on the menu icon to 'Add' new or 'Remove' any existing conditions to build complex expressions.
You can also create complex nested expressions that can be multi-level and builder will make sure they are grouped and formatted nicely to you can easily read through them.
Here is the list of some of the most commonly used expression.
Expressions
-
<expression>
-
<expression 1> is <expression 2>
-
<expression 1> is not <expression 2>
-
<expression 1> is greater than <expression 2>
-
<expression 1> is less than <expression 2>
-
<expression 1> is at least <expression 2>
-
<expression 1> is at most <expression 2>
-
<expression 1> is greater than or equal to <expression 2>
-
<expression 1> is less than or equal to <expression 2>
-
<expression 1> has a value
-
<expression 1> does not have a value
Constants
-
true
-
false
-
'<string constant>'
-
<number constant>
Functions
-
now()
-
today()
-
invalid()
-
valid()
-
readOnly()
-
length()
-
first()
-
last()
Paths
-
Relative Paths ( <level>, ./<level>, ../<level>)
-
Absolute Paths
-
/request
-
/activities
-
/activity
-
/inputs
-
/outputs
-
/requestType/name
-
/requestId
Logical Expressions
-
(<expression 1>) and (<expression 2>)
-
(<expression 1>) or (<expression 2>)
-
((<expression 1>) and (<expression 2)) or (<expression 3>)