Expression
Description
The Expression
type defines a special case of presentational component. An Expression
represents a mathematical expression that may be dynamically evaluated. Variables within an expression may be defined by prefixing their numeric ordering with a $
symbol, e.g. $0
would represent a variable to be populated with the value of the first parameter, $1
would represent a variable populated with the value of the second parameter e.g. Expression('$0 * $1 + 1').evaluate(2, 3)
would output 7
because the expression variables have been substituted from $0
to 2
and $1
to 3
, making the final evaluation 2 * 3 + 1
.
Properties
expression
(string
, required)
Example
{
"expression": "floor($0)"
}