> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/dataset/updatedata.md).

# 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
