setDelimiters
Sets the delimiters for the current list of actions.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | The parameters for the action | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"leadingDelimiter" (required) | String | The leading delimeter string | null |
"trailingDelimiter" (required) | String | The traling delimeter string | 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
Set Delimiter action
Goal: When the random event is fired, then the action chain will get count from table1
and show the value as using showMessage
action. Afterward, the action chain will compare the counts from table1
and table2
and show message.
{
"events": {
"name": "randomEvent",
"leadingDelimiter": "{{",
"trailingDelimiter": "{{",
"actions": [
{
"type": "executeQuerySQL",
"params": {
"async": false,
"sql": "Select count(*) FROM table1) as table1_count",
"queryParams": [],
"onSuccess": "table1_count",
"onSuccessType": "return"
}
},
{
"type": "showMessage",
"params": {
"text": "{{table1_count.results.0.table1_count}}{{table1_count.results.first.table1_count}}"
}
},
{
"type": "executeQuerySQL",
"params": {
"async": false,
"sql": "SELECT (Select count(*) FROM table1) as table1_count, (Select count(*) FROM table2) as table2_count",
"queryParams": [],
"onSuccess": "count",
"onSuccessType": "return"
}
},
{
"type": "setDelimiters",
"params": {
"leadingDelimiter": "{&",
"trailingDelimiter": "&}"
}
},
{
"type": "if",
"params": {
"async": false,
"condition": {
"left": {
"value": "{&count.results.0.table1_count&}{&count.results.first.table1_count&}"
},
"mode": "equal",
"right": {
"value": "{&count.results.0.table2_count&}{&count.results.first.table2_count&}"
}
},
"then": [
{
"type": "showMessage",
"params": {
"text": "Values are equal"
}
}
],
"else": [
{
"type": "showMessage",
"params": {
"text": "Values are different"
}
}
]
}
}
]
}
}