> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Use datasets to look up whether record fields match a managed list of values inside Beam JavaScript transforms.

A dataset is a named list of string values, such as wallet addresses, contract addresses, or token IDs, that your JavaScript transforms query with `beam.contains()`. Changes made through the [Datasets API](https://docs.allium.so/beam/api-reference/datasets/list-datasets.md) apply to deployed pipelines **immediately**, with no redeploy.

Use a dataset to filter on any list of values that is large, changes often, or is shared across pipelines.

## Use `beam.contains()` in a transform

In a JavaScript (v8) transform, call `beam.contains()` with a dataset name and an array of values from the current record. It returns `true` if **any** value is in the dataset.

```javascript theme={null}
function transform(input) {
  if (beam.contains("DATASET_NAME", [input.field1, input.field2])) {
    return input;
  }
  return null; // drop records that don't match
}
```

| Argument | Type | Description |
| :- | :- | :- |
| `DATASET_NAME` | `string` | Name given in [Create dataset](https://docs.allium.so/beam/api-reference/datasets/create-dataset.md). Must belong to your organization. |
| `[input.field1, input.field2]` | `string[]` | Values from the current record to check. Evaluation stops at the first match. |

> [!NOTE]
>
> Lookups are exact and case-sensitive: `0xAbC` and `0xabc` are different values. Store values in the same case as your records, or normalize both sides in your transform.

### Example: keep transfers that involve a watchlisted wallet

```javascript theme={null}
function transform(input) {
  if (beam.contains("watchlist-wallets", [input.from_address, input.to_address])) {
    return input;
  }
  return null;
}
```

### Example: tag records sent to a known contract

```javascript theme={null}
function transform(input) {
  if (beam.contains("known-defi-contracts", [input.to_address])) {
    input.is_defi = true;
  }
  return input;
}
```

## Typical workflow

**1. Create the dataset**

Call [Create dataset](https://docs.allium.so/beam/api-reference/datasets/create-dataset.md) with a name that is unique within your organization. The response includes the `id` used by ID-based endpoints.

**2. Populate it**

Load values with [Add entries](https://docs.allium.so/beam/api-reference/datasets/add-entries.md) or [Add entries by name](https://docs.allium.so/beam/api-reference/datasets/add-entries-by-name.md). Each request accepts up to 250,000 values. Split larger uploads into chunks and send at most 5 requests concurrently.

**3. Reference it from a transform**

Call `beam.contains("DATASET_NAME", [...])` in a JavaScript transform, then [deploy](https://docs.allium.so/beam/api-reference/deployment/deploy.md) the pipeline.

**4. Update membership live**

Add or remove values with [Add entries](https://docs.allium.so/beam/api-reference/datasets/add-entries.md) and [Remove entries](https://docs.allium.so/beam/api-reference/datasets/remove-entries.md) at any time. Running pipelines see changes immediately, with no redeploy.

## Endpoints

> [card] [Create dataset](https://docs.allium.so/beam/api-reference/datasets/create-dataset.md)
>
> Create a dataset.

> [card] [List datasets](https://docs.allium.so/beam/api-reference/datasets/list-datasets.md)
>
> List your datasets.

> [card] [Delete dataset](https://docs.allium.so/beam/api-reference/datasets/delete-dataset.md)
>
> Delete a dataset and all of its entries.

> [card] [Add entries](https://docs.allium.so/beam/api-reference/datasets/add-entries.md)
>
> Add values to a dataset by ID.

> [card] [Add entries by name](https://docs.allium.so/beam/api-reference/datasets/add-entries-by-name.md)
>
> Add values to a dataset by name.

> [card] [List entries](https://docs.allium.so/beam/api-reference/datasets/list-entries.md)
>
> Paginate through a dataset's values.

> [card] [Remove entries](https://docs.allium.so/beam/api-reference/datasets/remove-entries.md)
>
> Remove specific values from a dataset.

> [card] [Check entry](https://docs.allium.so/beam/api-reference/datasets/check-entry.md)
>
> Check whether a value exists in a dataset.
