insertFromRequest
Inserts the response data into the SQLite database.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"additionalHeaders" | AdditionalHeaders | Additional HTTP headers which will be appended to the request. | null |
"appendDataToEvent" | Boolean,String | Specifies 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,String | Specifies whether the mos. GET params will be appended to the request. | false |
"appendMosHeader" | Boolean,String | Specifies whether the mos. headers will be appended to the request. | null |
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"contentType" | String | The content type of the request. | null |
"dataMapping" | Object | Used to map data from the requested object to the database table structure. | null |
"insertType" | InsertType | Type of the insert into the database. | "replace" |
"localImages" | Array | The list of locally saved images to append to the request. | null |
"maxRetries" | Number | The number of the maximum allowed retries to perform the request. | 0 |
"method" | String | The HTTP method. | null |
"onError" | String | The name of the event that will be fired if action failed. | null |
"onErrorType" | OnErrorType | Type of event that will be fired on error. | null |
"onSuccess" | String | The name of the event that will be fired if action is performed successfully. | null |
"onSuccessType" | OnSuccessType | Type of event that will be fired on success. | null |
"post" | Object | The object that contains the request body. | null |
"query" | String | Path to the array of objets to insert. | null |
"queryMap" | Array | The map for adding database data to the request body. | null |
"retryDelay" | Number | The delay in seconds between retries. | 0 |
"showRetry" | Boolean,String | Specifies whether currently performed retry is shown in the overlay. | false |
"table" (required) | String | The name of the database table to insert retrieved data to. | null |
"url" (required) | String | The URL of the data source. | 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: 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.