if
An if expression.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"condition" (required) | Object | The expression to use as condition. | null |
"else" | Array | List of actions to execute if the condition is false. | null |
"then" | Array | List of actions to execute if the condition is true. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Execute an if query
Goal: Create an if action checking whether a specific field exists.
The condition
parameter specifies the expression that is used as the condition for the if query.
{
"type": "if",
"params": {
"condition": {
"left": {
"context": "namedForm",
"field": "shroedingersCat"
},
"mode": "exists"
},
"then": [
{
"type": "showMessage",
"params": {
"text": "does exist"
}
}
],
"else": [
{
"type": "showMessage",
"params": {
"text": "does not exist"
}
}
]
}
}
Depending on the result of the if query, either the actions in the then
or else
parameter are executed.
Result:
An if action has been created.