setTimeout
Executes actions at a later time.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"actions" (required) | Array | The list of actions to be executed. | null |
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"background" | Boolean,String | Specifies whether the actions should also be executed in the background. | false |
"name" | String | Name of the timeout. The timeout can be canceled later using this name. | null |
"onlyForeground" | Boolean,String | Specifies whether the actions should only be executed when the app is active. | true |
"repeat" | Boolean,String | Specifies whether the timeout should be executed multiple times. | false |
"time" | Number,String | The time in seconds after which the actions are to be executed. | 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: 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:
A setTimeout action has been created.