# updateData

## Description

Update a record from a staging database.

## Input / Parameters

| No | Name    | Description                                                                         | Data Type | Required |
| -- | ------- | ----------------------------------------------------------------------------------- | --------- | -------- |
| 1  | dataset | Name of the dataset in staging table where record will be updated.                  | String    | Yes      |
| 2  | \_id    | Value from the staging database and used for identify which record will be updated. | Integer   | Yes      |
| 3  | param   | The data to be updated from the staging database.                                   | Object    | Yes      |

## Output

## Callback

## Video

## Example

The user wants to update the data from staging table.

### Step

1. Create a table with a table name and field in staging table and create a dataset in Services. (We assumed that the table , field and dataset have been created.)\
   table name: customer\
   Fields name: tel, name and add\
   Dataset: customer\_1\
   Set value: tel:111222333, name: abc, add:124,jalan tresa

![](/files/jxrCVdfCpfJ4ryeNnEia)

![](/files/hNdL9hlRXls0BZhFdws8)

2. Call the function "updateData", define the dataset & id and set function "toObject"to param.\
   dataset: customer\_1\
   \_id: 4\
   param: toObject

![](/files/gER1442HVv96Yj2mV39o)

3. Define the tel.\
   tel: 123<br>

![](/files/43PAy2k5nXD2AeZQBUku)

4. Call the function "loadData" and set the dataset.\
   dataset: customer\_1<br>

![](/files/J9jyjx1UQjUr1gqV1LuD)

5. Add a console after callback for display the response from console.

![](/files/qeVhEmZzXgBESYbpPh3L)

### Result

![](/files/7Un4eLw4cKsfmWsSXr9H)

![](/files/dq9qBLTGc2mjrL52e9HE) ( The row 2, tel no have been successful to be update into no 123.)

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