# clearData

## Description

Removes the local table specified from a project.

## Input / Parameter

| Name    | Description                                     | Input Type  | Default | Options | Required |
| ------- | ----------------------------------------------- | ----------- | ------- | ------- | -------- |
| dataset | The name of the dataset to remove.              | String/Text | -       | -       | Yes      |
| extra   | Extra parameters stored and passed to callback. | Any         | -       | -       | No       |

## Output

| Description            | Output Type |
| ---------------------- | ----------- |
| Returns an empty list. | Array/List  |

## Callback?

### callback

The function to be executed if the dataset is removed successfully.

### errorCallback

The function to be executed if the dataset is not removed successfully.

## Video

Coming Soon.

## Example

The user wants to delete the dataset `lcart` from local table.

### Step

1. Create a local table `lcart`.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-ab0552c07cac6eaeb362bb35e8ab8549e0d75576%2FclearData-step-1.png?alt=media)
2. Add some fields for the table:

   ```
   item_code
   item_name
   price
   quantity
   ```

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-8688f17391ab956005843253e40255c4c529f9e1%2FclearData-step-2.png?alt=media)
3. Call the "clearData" function and define the dataset.

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

   ```
   dataset: l_cart
   ```

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-452b05a62b7bbfdb8baabb51b5b6401d6f656f1f%2FclearData-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-9748c748b6048eb7fc0cf200ce5e92061ba164a0%2FclearData-result-1.png?alt=media)

Before calling the `clearData` function, the dataset `lcart` exists as a local table. )

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

After calling clearData, l\_cart no longer exists.

## Links
