# Use data from earlier steps

Field mappings let each run use its own recipient, message, or decision data. A connection chooses the next step; a mapping chooses a value for that step's input.

> Automations is in Early access. Your workspace permissions determine which actions you can perform.

## Choose a field's value

Connect the step you want to configure after its data source. The source picker depends on the selected step and the paths that can reach it.

The modes offered depend on the field:

| Mode  | Purpose                                                                             |
| ----- | ----------------------------------------------------------------------------------- |
| Fixed | Enter a value that stays the same across runs.                                      |
| Value | Select data from the trigger, an earlier step, or a variable.                       |
| Text  | Combine text with inserted values, such as a greeting and a customer name.          |
| fx    | Enter a Common Expression Language (CEL) expression for a calculation or condition. |
| List  | Configure a list where the field accepts multiple values.                           |

To use an earlier value:

1. Select the destination step on the canvas.
2. Open the field's value control and choose the source you need.
3. Check that the selected field has the right type, such as text for an email address.
4. Inspect **Step preview** with sample data to see the resolved input.

An expression keeps its result type. Text with inserted values produces text. A text value containing digits does not automatically become a number.

## Example: personalize a greeting

Start with a draft from the [SMS notification template](/docs/get-started/automations) and choose a sender. Its trigger includes a **Customer name** field.

1. Select **Send SMS notification** and open **Edit message**.
2. In **Message**, keep **Text** mode and replace the existing content with `Hi` followed by a space.
3. Select **Insert data** and choose **Customer name** under **Notification requested**. Add `, your appointment is confirmed.` after the inserted value.
4. Expand **Test with sample data** and use a trigger sample with `customer_name` set to `Ada`.
5. Select **Preview step**, or **Refresh preview** if a result is already shown. The prepared message reads `Hi Ada, your appointment is confirmed.`

Changing the sample name and selecting **Refresh preview** updates the greeting. The inserted field supplies the name for each run.

## Understand the sources

| Source              | Example use                                                             |
| ------------------- | ----------------------------------------------------------------------- |
| Trigger data        | The appointment ID or recipient supplied when the run starts.           |
| Earlier step output | The contact returned by Get contact or message ID returned by Send SMS. |
| Earlier step error  | The failure information used on an action's failure path.               |
| Variables           | Named values created by Set values.                                     |

**Set values** is useful when later steps need the same calculation. For example, prepare a customer display name once, then insert that variable into multiple messages.

## Handle missing and conditional data

A field can be absent, empty, or explicitly have no value. Decide what the workflow should do in each case. For a missing name, a generic greeting may be appropriate. For a missing recipient, take another path or end the run.

After a branch, an output exists when the run took the path that produced it. If an email path and an SMS path reconnect, the shared step cannot assume both sends happened.

Use a condition before reading optional data, or assign a shared variable on each incoming path. The source picker distinguishes values available on some paths. A sample showing one successful path does not make its output available on another path.

Advanced CEL expressions use names such as `trigger.data.data`, `steps.lookup.output`, and `variables.customer_name`. The step ID in an expression must match the actual source step. Prefer the picker when available so it selects the source for you.

## Check calculated values

Preview a typical input, a missing optional field, and each relevant branch. A prepared input can still fail during a real run if incoming data has a different type or a required value is missing.

An earlier output is the value recorded when that step ran. Reusing it after a delay does not fetch the contact or message again. Add another read step if the decision requires current data.

## Next steps

- [Send messages](/docs/guides/automations/messages).
- [Preview and check a workflow](/docs/guides/automations/preview).
- [Troubleshoot an automation](/docs/guides/automations/troubleshooting).
- [Browse the Automations guides](/docs/guides/automations).