# insertData

## Description

Insert or add value in a staging database.

## Input / Parameters

| No | Name    | Description                                                              | Data Type | Required |
| -- | ------- | ------------------------------------------------------------------------ | --------- | -------- |
| 1  | dataset | Name of the dataset in stagging table where the record will be inserted. | String    | Yes      |
| 2  | param   | Object name                                                              | Object    | Yes      |

## Output

## Callback

## Video

## Example

The user wants to insert the data into staging table.

### Step

1. Create a table with a table name and field in staging table.\
   table name: customer\
   Fields name: tel, name and add

   ![](/files/kjllACjgXz2w130PDYer)

   ![](/files/7U83CD1ZlghiXciJI3lu)
2. Create a dataset is in Services.\
   dataset: customer\_1<br>

   ![](/files/vEGIjUAmR8VpLYwdBevx)
3. Call the function "insertData", define the dataset and set function "toObject"to param.\
   dataset: customer\_1\
   param: toObject<br>

   ![](/files/DogF19LaT7IwDJ3X8uR2)
4. Define the tel, name and add.\
   tel: 34345678\
   name: 111\
   add: abc<br>

   ![](/files/dbcNwQ2iayxfOdoFh6Yl)
5. Call the function "loadData"and define the dataset.\
   dataset: customer\_1<br>

   ![](/files/IFbO4N53B8EN70FFkKPI)
6. Add a console after callback for display the response from console.

   ![](/files/b7zHMCr5y303i5wJD7Z0)

### Result

![](/files/Mjy5XnhYG93lKoXGjvqz)

![](/files/8uta2vgiRnGw8OFZLr9e)

## Notes

* N/A


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/dataset/insertdata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
