Skip to main content

setDelimiters

Sets the delimiters for the current list of actions.

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)ObjectThe parameters for the actionnull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"leadingDelimiter" (required)StringThe leading delimeter stringnull
"trailingDelimiter" (required)StringThe traling delimeter stringnull

Inherited

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType 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"
}
}
]
}
}
]
}
}