Skip to main content

setTimeout

Executes actions at a later time.

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"actions" (required)ArrayThe list of actions to be executed.null
"async"BooleanSpecifies whether the action should perform asynchronously.null
"background"Boolean,StringSpecifies whether the actions should also be executed in the background.false
"name"StringName of the timeout. The timeout can be canceled later using this name.null
"onlyForeground"Boolean,StringSpecifies whether the actions should only be executed when the app is active.true
"repeat"Boolean,StringSpecifies whether the timeout should be executed multiple times.false
"time"Number,StringThe time in seconds after which the actions are to be executed.null

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

Example 1: Set a timeout

Goal: Create a setTimeout action executing a showMessage action after 10 seconds.

The timeout should only be executed once, therefore the repeat parameter is set to false.

{
"type": "setTimeout",
"params": {
"name": "laterMessage",
"repeat": false,
"onlyForeground": true,
"time": 10,
"actions": [
{
"type": "showMessage",
"params": {
"text": "10 seconds passed"
}
}
]
}
}

The actions to be executed are specified in the actions parameter, in this case a showMessage action.

Result:

Screenshot of the app showing the results of the sample code from Example 1.
A setTimeout action has been created.