Skip to main content

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

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.null
"error"StringEvent to be fired if action failed.null
"source"ObjectThe source of the data. For more information about the source object, see database table source.null
"success"StringEvent to be fired if action is successfull.null
"table"ObjectThe name of the database table.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: 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.