# Lookup (/docs/nodes/lookup)



The **Lookup** node checks whether a value exists in a **dataset**, reference data such as a blocklist or a list of country codes, and hands back the matching row when it does.

## When to use it [#when-to-use-it]

* Screen against a blocklist or allowlist.
* Enrich the decision with data about a code: a country risk tier, a merchant category.

## How it works [#how-it-works]

<Diagram node="lookup" kind="anatomy" />

1. The dataset is resolved at the version pinned when the flow was published.
2. The **key** expression is evaluated. It must produce a text or a number; a missing value is simply "not found".
3. The row whose key column equals it is searched, optionally ignoring case and surrounding spaces.
4. Found takes **Found** and stores the row; otherwise **Not found** is taken and the variable is `null`.

## Ports [#ports]

| Port        | Taken when                                                                                                     |
| ----------- | -------------------------------------------------------------------------------------------------------------- |
| `Found`     | A row matched the key.                                                                                         |
| `Not found` | No row matched. If this port is not connected, the run carries on through Found with the variable left `null`. |

## Configuration [#configuration]

| Field           | What it does                                                    |
| --------------- | --------------------------------------------------------------- |
| Name            | Label shown on the canvas and in the trace.                     |
| Dataset         | The reference data to search. Its version is pinned at publish. |
| Key             | The value to look for in the dataset's key column.              |
| Ignore case     | Match ignoring case and surrounding spaces.                     |
| Store result in | The variable that receives the row, or `null`.                  |

## What it writes [#what-it-writes]

The variable holds the whole matched row (`vars.match.risk_tier`) or `null`. The trace states what was looked up, where, and the dataset version.

## In a real flow [#in-a-real-flow]

<Diagram node="lookup" kind="example" />

The country is looked up in a blocklist. A hit goes to manual review, a miss goes straight to the output.

## When it fails [#when-it-fails]

* The dataset is not found: `DATASET_NOT_FOUND`.
* The key is an object or a list: `VALIDATION_FAILED`. Only text or numbers can be looked up.
* No dataset or no key is an error in Checks.

## Good to know [#good-to-know]

* Datasets are immutable versions. To pick up new data, upload a new version and republish.

## Related [#related]

* [Datasets guide](/docs/guides/datasets)
* [Condition](/docs/nodes/condition)
