# AI Data Transform

> Pull values out of messy text (an email, a receipt, a transcript) with up to three plain-language instructions.

**AI Data Transform** reshapes data into the format you need. Give it up to three plain-language instructions and it hands back one answer per instruction, in the order you wrote them.

It is at its most useful on text with no fixed shape, like a customer email, a scanned receipt or a meeting transcript. You do not need to know how the data is formatted underneath.

![The AI Data Transform step selected on the canvas, with its panel open on the Instructions list.](/images/docs/ai/ai-transform-step.webp)
*Write one instruction per value you want. The step returns an answer for each, in the order you wrote them.*

## AI Data Transform or AI Prompt?

Both use Glow's managed models, and both see only the data you reference. AI Prompt makes one model call; AI Data Transform makes one concurrent call per instruction. The other difference is the shape of what comes back:

| You want                                  | Use                                                                                      |
| ----------------------------------------- | ---------------------------------------------------------------------------------------- |
| Up to three ordered values from one text  | **AI Data Transform**: one positional answer per instruction                             |
| One answer, worded or structured your way | [AI Prompt](/build/ai-features/ai-prompt): a single result you shape with Response shape |

For a single value, either works. AI Data Transform needs less setup; AI Prompt gives you control over the answer's wording and structure.

## Setting it up

### Add the step

Open **Tools** in the dock and choose **AI Data Transform**. On the canvas, right-click and pick it under **Data**.

### Write one instruction per value

The step has one field: **Instructions**, a list you can add up to three entries to. There is no separate input box. For a fourth value out of the same text, use [AI Prompt](/build/ai-features/ai-prompt) with **Response shape**, which takes one field per value you want back. You point each instruction at the text by step number, the same way you reference a value anywhere else:

> Extract the customer's order number from `{{ 2.ret.body }}`

The step sees only what your instruction references. Use the data picker to insert the reference rather than typing it: the path depends on which step produced the text.

## What it passes on

The step returns one answer per instruction, in the order you wrote them:

| Reference          | What it holds                      |
| ------------------ | ---------------------------------- |
| `{{ N.result.0 }}` | the answer to your 1st instruction |
| `{{ N.result.1 }}` | the answer to your 2nd instruction |
| `{{ N.result.2 }}` | the answer to your 3rd instruction |

Because the answers are positional, reordering your instructions changes what every later reference points at. If you want values you can address by name, ask a single instruction to return JSON and use [Parse JSON](/build/action-steps/parse-json) on the result.

## Limits

You can add up to three instructions. For a fourth value from the same text, use [AI Prompt](/build/ai-features/ai-prompt) with **Response shape**, which returns named fields in one result.

> How accurate the answers are depends on how clear the source text is. Give it
> a smudged scan or an ambiguously worded email, and the answer may be
> confidently wrong.
>
> For anything that costs money or cannot be undone, put a
> [Human Review](/build/action-steps/user-approval) step between the extraction
> and the action. A person then sees the values before they are used.

## Examples to copy

Reach for AI Data Transform when the information you need is in there somewhere but never in the same place twice:

- **A receipt or invoice**: instruction 1 asks for the supplier, instruction 2 the total, and instruction 3 the due date. Read them as `{{ N.result.0 }}`, `{{ N.result.1 }}` and `{{ N.result.2 }}`.
- **An inbound email**: extract the sender's job title, their company size and what they are asking for.
- **A meeting transcript**: extract the owner, the agreed action and its due date.

If the text always arrives in exactly the same shape, [Split Text](/build/action-steps/split-text) or [Parse JSON](/build/action-steps/parse-json) will do the job faster and without an AI call.

## What's Next?

- Need one shaped answer instead of positional values? [AI Prompt](/build/ai-features/ai-prompt).
- Put a reviewer in front of important extractions with [Human Review](/build/action-steps/user-approval).
- For work that needs several steps of judgement rather than one extraction, use the [AI Agent](/build/ai-features/ai-agent).
