---
title: "Field rules"
description: "How rules rename, merge, and split fields before emails and webhooks go out, and the order they run in."
---

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

# Field rules

A **field rule** reshapes a submission's fields on their way out. It can rename a field, merge several fields into one, or split one field into several. Rules change what notification emails, the auto-reply, and webhooks receive. The inbox always shows fields exactly as the site sent them.

Each rule belongs to one level: your agency, or a single form. A rule applies to everything beneath its level, so an agency rule shapes every form your agency runs.

## Why rules exist

The site's markup and the tools downstream rarely agree on field names. One developer writes `fname`, another `first_name`; the CRM wants `FirstName`. Rules let you fix that once in Atomicity instead of editing every form on every site, or writing glue code in a webhook receiver.

Keeping the inbox untouched is deliberate: when a rule does something unexpected, the original submission is still there to compare against.

## The three rule types

| Type | What it does | Example |
| --- | --- | --- |
| **Rename** | Gives one field a new name. | `fname` → `first_name` |
| **Merge** | Joins two or more fields into one, with a space between unless you change it. Empty fields are skipped. | `first`, `last` → `name`: "Jane Doe" |
| **Split** | Breaks one field into two or more at each space, or another separator you choose. The last field takes whatever is left over, so nothing is dropped. | `name`: "Jane van Doe" → `first`: "Jane", `last`: "van Doe" |

Each rule reads as a plain sentence in its list, such as: Merge "first", "last" into "name", joined with a space.

Given this post and the merge rule above:

```json title="Sent by the site"
{ "first": "Jane", "last": "Doe", "email": "jane@example.com" }
```

```json title="Received by emails and webhooks"
{ "name": "Jane Doe", "email": "jane@example.com" }
```

## The order rules run in

Rules run broadest first: **agency rules, then form rules**. Within a level they run in the order they were added. A form's **Settings → Rules** tab lists the agency rules that also apply to it, under **These also apply to this form**.

Then the reshaped fields go out, in this order:

```txt
Agency rules → Form rules → Notifications → Webhooks → Auto-reply
```

## Boundaries

- A rule whose fields aren't in the submission is skipped. A form can share an agency rule without sending every field it mentions.
- Once a rule has used a field, later rules can't use that field again. A field renamed by an agency rule can't be renamed again by a form rule under its old name.
- A rename doesn't overwrite a different field that already has the new name. The rule is skipped instead.
- Rules don't filter or drop fields, validate values, or change spam scoring.
- Rules don't change the inbox or search; those always use the original fields.

## See also

- [Agency rules](https://docs.atomicity.dev/workspace/agency-rules/)
- [Notifications and auto-reply](https://docs.atomicity.dev/forms/notifications-and-auto-reply/)
- [Form webhooks](https://docs.atomicity.dev/forms/webhooks/)

Source: https://docs.atomicity.dev/forms/rules/index.mdx
