Skip to main content

insertFromParams

Inserts the given event Parameters into the SQLite database.

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"async"BooleanSpecifies whether the action should perform asynchronously.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"
"onError"StringEvent that is fired in case of an error.null
"onErrorType"OnErrorTypeType of event that will be fired on error.null
"onSuccess"StringEvent that is fired in case of success.null
"onSuccessType"OnSuccessTypeType of event that will be fired on success.null
"query" (required)StringPath to the array of objects to insertnull
"table" (required)StringThe name of the SQLite database table to insert to.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: Insert into an SQLite database from parameters

Goal: Create an insertFromParams action inserting objects from the parameters.

To achieve this the following code can be used:

{
"type": "insertFromParams",
"params": {
"table": "news",
"query": "results",
"insertType": "insertOrUpdate",
"onSuccess": "insertSuccess",
"onError": "insertError"
}
}

The query parameter refers the objects that are to be inserted.

Result:

An insertFromParams action has been created.