Skip to main content

insertFromRequest

Inserts the response data into the SQLite database.

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"additionalHeaders"AdditionalHeadersAdditional HTTP headers which will be appended to the request.null
"appendDataToEvent"Boolean,StringSpecifies whether the request data should be appended to the eventParams for the success event (Can cause issues on large data sets due to memory limitations).false
"appendMosGetParams"Boolean,StringSpecifies whether the mos. GET params will be appended to the request.false
"appendMosHeader"Boolean,StringSpecifies whether the mos. headers will be appended to the request.null
"async"BooleanSpecifies whether the action should perform asynchronously.null
"contentType"StringThe content type of the request.null
"dataMapping"ObjectUsed to map data from the requested object to the database table structure.null
"insertType"InsertTypeType of the insert into the database."replace"
"localImages"ArrayThe list of locally saved images to append to the request.null
"maxRetries"NumberThe number of the maximum allowed retries to perform the request.0
"method"StringThe HTTP method.null
"onError"StringThe name of the event that will be fired if action failed.null
"onErrorType"OnErrorTypeType of event that will be fired on error.null
"onSuccess"StringThe name of the event that will be fired if action is performed successfully.null
"onSuccessType"OnSuccessTypeType of event that will be fired on success.null
"post"ObjectThe object that contains the request body.null
"query"StringPath to the array of objets to insert.null
"queryMap"ArrayThe map for adding database data to the request body.null
"retryDelay"NumberThe delay in seconds between retries.0
"showRetry"Boolean,StringSpecifies whether currently performed retry is shown in the overlay.false
"table" (required)StringThe name of the database table to insert retrieved data to.null
"url" (required)StringThe URL of the data source.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: Simple insertFromRequest

Goal: Send a GET method request to the given URL as a JSON object,append UID as a header and insert retrieved data to the detabase table users.

{
"type": "insertFromRequest",
"params": {
"method": "GET",
"url": "https://example.mobilitysuite.de/get",
"table": "users",
"insertType": "replace",
"contentType": "json",
"additionalHeaders": [
{
"type": "userSetting",
"headerName": "user",
"key": "AF_SETTING_USERUID"
}
],
"onError": "dataInsertSuccess",
"onSuccess": "dataInsertError"
}
}

Result:

An insertFromRequest action has been created.