Actions
Actions represent user interactions with the application or what to do after triggering an event. They can be added to almost any layer to make it clickable and are then triggered by the user's touch. The actions added to a layer are executed one after the other in the order in which they were added.
You can also specify how the app handles the result of another action. To this end, some actions can define an onSuccess
and onError
field in which an event can be named that is triggered after the action is completed. Depending on the action (e.g. the action request), the result data is added to the event as an event parameter.
The type
field of an action defines the type of the action and can also be referred to as its "name". The parameters of the action are entered in the params
field of the JSON object. While most actions require parameters in order to be configured correctly, this is not the case for some.
Exampleโ
Example configuration of a showMessage
action.
{
"actions": [
{
"type": "showMessage",
"params": {
"text": "This will be displayed as a toast."
}
}
]
}
Index of all action typesโ
Below is a complete list of all actions:
๐๏ธ addCalendar
Opens the default calendar of the user's device and shows a pre-filled "add new event" view with the provided data. Depending on the operating system and its version, this could manifest as just an in-app overlay or a complete switch to the calendar app.
๐๏ธ addContact
Opens the contacts of the user's device and shows a pre-filled "add new contact" view with the provided data. Depending on the operating system and its version, this could manifest as just an in-app overlay or a complete switch to the contacts app.
๐๏ธ addDataSource
The addDataSource action enables you to add a new database (or just its source) to your application. This is used often if the desired source is not available at a previous point in you configuration or certain parts of the source are depending on not yet available data, i.e. before the user is logged in or got its credentials.
๐๏ธ addGeofences
Adds a geofence too look for.
๐๏ธ alert
This action triggers an alert in the form of the device's vibration and/or default notification sound.
๐๏ธ askUser
Shows a modal pop-up with buttons in the style of the operating system. The lists of buttons and events reference each other so that the button with a specific index will trigger the corresponding event with the same index.
๐๏ธ backInHistory
This action triggers the back navigation of your view stack. As long as there is a view on your stack, the view is popped and the previous view is displayed.