# selectBy

## Description

Retrieves the specified field from a local table.

## Input / Parameter

| Name     | Description                                             | Input Type  | Default | Options                          | Required |
| -------- | ------------------------------------------------------- | ----------- | ------- | -------------------------------- | -------- |
| dataset  | The name of the local table to select the records from. | String/Text | -       | -                                | Yes      |
| by       | The name of the field to select the records from.       | String/Text | -       | -                                | Yes      |
| operator | The operator to use to determine the records to select. | String/Text | =       | =, >, <, >=, <=, !=, like, ilike | No       |
| value    | The records to be selected 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 list of records selected from the local table. | Array/List  |

## Callback?

### callback

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

### errCallback

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

## Video

Coming Soon.

## Example

The user wants to display the data which id=1 in dataset "l\_item".

### Step

1. Call the function "selectBy"

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

   |         |         |
   | ------- | ------- |
   | dataset | l\_item |
   | by      | id      |
   | value   | 1       |

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

### Result

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

## Links
