# deleteBy

## Description

Removes specified records from a dataset.

## Input / Parameter

| Name     | Description                                             | Input Type  | Default | Options                          | Required |
| -------- | ------------------------------------------------------- | ----------- | ------- | -------------------------------- | -------- |
| dataset  | The name of the local table to remove the record from.  | String/Text | -       | -                                | Yes      |
| by       | The name of the field to remove the record from.        | String/Text | -       | -                                | Yes      |
| operator | The operator to use to determine the records to remove. | String/Text | =       | =, >, <, >=, <=, !=, like, ilike | No       |
| value    | The records to be removed from the local table.         | String/Text | -       | -                                | Yes      |
| first?   | ?                                                       | String/Text | -       | -                                | No       |
| 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 specified records are removed successfully.

### errorCallback

The function to be executed if the specified records are not removed successfully.

## Video

Coming Soon.

## Example

The user wants to delete the id=7 from dataset "l\_customer".

### Step

1. Call the function "deleteBy" and define the dataset, by, and value.\
   dataset: l\_customer\
   by: id\
   value: 7<br>

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

### Result

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-da9a6327fbc55824ece08650afe847dee1a876dc%2FdeleteBy-result-1.png?alt=media) ( Before delete, id=7 is still display in the dataset "l\_customer" )

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-73ecb2ce9dfa3f7ed7c6ea77db78391530da5285%2FdeleteBy-result-2.png?alt=media) ( After delete, id=7 was being removed )

## Links
