addDataSource
The addDataSource action enables you to add a new database (or just its source) to you 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.
note
Database tables with sources enable you to add and/or update data regualary in the given interval by the source
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"error" | String | Event to be fired if action failed. | null |
"source" | Object | The source of the data. For more information about the source object, see database table source. | null |
"success" | String | Event to be fired if action is successfull. | null |
"table" | Object | The name of the database table. | 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: Create a addDataSource action
Goal: Add a data source to the database table "bookings".
table
, source
, success
and error
keys have to be assigned within the params
object of the action.
{
"type": "addDataSource",
"params": {
"table": {
"name": "bookings"
},
"source": {
"type": "insertOrUpdate",
"dataQuery": "items",
"request": {
"method": "GET",
"url": "https://example.mobilitysuite.de/dataSource",
"appendMosHeader": false
},
"update": {
"type": "polling",
"standardDuration": "standard",
"durations": {
"standard": 600
}
}
},
"success": "addSourceSuccess",
"error": "addSourceError"
}
}
Result:
The data source for database table "bookings" has been added.