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

# Form Rules

> Conditional routing based on submission data

Form rules let you create conditional logic for your form submissions. Route emails to different recipients, redirect to custom pages, or trigger webhooks based on form field values.

## How Rules Work

Each rule has:

* **Conditions**: Field comparisons that must be true (AND logic)
* **Actions**: What happens when conditions match
* **Priority**: Higher priority rules are evaluated first

## Creating Rules

In your form settings, go to the Rules tab and click "Add Rule".

### Conditions

Available operators:

| Operator       | Description                    |
| -------------- | ------------------------------ |
| `equals`       | Exact match (case-insensitive) |
| `not_equals`   | Does not match                 |
| `contains`     | Field contains value           |
| `not_contains` | Field does not contain value   |
| `starts_with`  | Field starts with value        |
| `ends_with`    | Field ends with value          |
| `is_empty`     | Field is empty                 |
| `is_not_empty` | Field has a value              |
| `greater_than` | Numeric comparison             |
| `less_than`    | Numeric comparison             |

### Actions

| Action     | Description                       |
| ---------- | --------------------------------- |
| Send email | Route to a specific email address |
| Redirect   | Send user to a custom URL         |
| Webhook    | POST to a custom endpoint         |
| Tag        | Add a tag for filtering           |

## Examples

### Route by Department

Send sales inquiries to the sales team:

```
Condition: department equals "sales"
Action: Send email to sales@company.com
```

### VIP Redirect

Redirect enterprise leads to a special page:

```
Condition: company_size greater_than 100
Action: Redirect to /enterprise-thanks
```

### Support Ticket Webhook

Trigger a webhook for support requests:

```
Condition: type equals "support"
Action: Webhook to https://api.helpdesk.com/tickets
```

## Multiple Conditions

Rules use AND logic - all conditions must match:

```
Condition 1: country equals "US"
Condition 2: budget greater_than 10000
Action: Send email to enterprise-us@company.com
```

## Priority

When multiple rules match, higher priority rules execute first. Set priority in the rule settings (1-100, higher = first).

<Note>
  Rules are evaluated in order of priority. The first matching redirect action will be used.
</Note>
