> 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/deletedata.md).

# deleteData

## Description

Delete a record from a staging database.

## Input / Parameters

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

## Output

## Callback

## Video

## Example

The user wants to delete the data from staging table.

### Step

1. Create a table with a table name and fields in staging table and create a dataset in Services. (We assumed that the table , fields and dataset have been created.)\
   table name: customer\
   Fields name: tel, name and add\
   Dataset: customer\_1\
   Set value: tel:34345678, name: 111, add:abc<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-41732e20b2ef45ddb8e4a2537f8600e1eb771aa4%2FdeleteData-step-1.png?alt=media)
2. Call the function "deleteData", define the dataset and id.\
   dataset: customer\_1\
   \_id: 10<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-373e912c7d736c888665babfaa885d15fee405b5%2FdeleteData-step-2.png?alt=media)
3. Call the function "loadData" and set the dataset.\
   dataset: customer\_1<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-150dc45c3e327896411cb8cde3161c69539ebe1f%2FdeleteData-step-3.png?alt=media)
4. Add a console after callback for display the response from console.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-e3376923a7ecf820f825cd6738af749deaef5be5%2FdeleteData-step-4.png?alt=media)

### Result

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-781aa06465d057dccb8da6afbb8ec8f0e88e3cae%2FdeleteData-result-1.png?alt=media)

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-cb051423175ffabbad718e61f67d9209e430373c%2FdeleteData-result-2.png?alt=media)\
( The result display in editor.)

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-8364f74788503f6df7bda34197919469ad48b762%2FdeleteData-result-3.png?alt=media) ( The row for tel:34345678, name: 111, add:abc have been remove successfully.)

## Links
