# insert

## Description

Inserts values specified by the user into a local table.

## Input / Parameter

| Name    | Description                                       | Input Type  | Default | Options | Required |
| ------- | ------------------------------------------------- | ----------- | ------- | ------- | -------- |
| dataset | The name of the local table to be insert data to. | String/Text | -       | -       | Yes      |
| dt      | The values to be inserted in the local table.     | Object      | -       | -       | Yes      |
| extra   | Extra parameters stored and passed to callback.   | Any         | -       | -       | No       |

## Output

| Description                                | Output Type |
| ------------------------------------------ | ----------- |
| Returns the updated local table as a list. | Array/List  |

## Callback?

### callback

The function to be executed if the local table is updated with the new records successfully.

### errCallback

The function to be executed if the local table is not updated with the new records successfully.

## Video

Coming Soon.

## Example

The user wants to insert the id=23 into the dataset "l\_customer".

### Step

1. Call the function "insert" and define the dataset and dt.\
   dataset: l\_customer<br>

   ![](/files/jABIBaZWSbKI2uiyqtUl)
2. Set toObject function to dt and define the value of object.\
   dt: toObject\
   id: 23\
   code: C12345\
   name: ABC<br>

   ![](/files/ADqOI4aiq5ZQJKMN1qio)

### Result

![](/files/25Wedzsy5tjHigEadLTC) ( Before insert, the id is until id=22 )

![](/files/JjqM7PJIJUDSX9w0O13r) ( After insert, the id=23 successful add into the dataset "l\_customer" )

## Links


---

# 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/insert.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.
