# Hidden fields

> Pass values such as a campaign, a customer id or a plan through the form link, and store them with each response without asking.

A hidden field is a value that arrives in the form's link rather than from a question. Use one to record where a respondent came from, who they are in your own system, or which version of a page they saw, without asking them.

```
https://formhelix.example/f/k3Xb9QpL2a?source=newsletter&customer=4812
```

A form with hidden fields `source` and `customer` stores `newsletter` and `4812` with that response.

## Adding hidden fields

1. Open the form's **Settings** tab and choose **Hidden fields**.
2. Add a **Field name**. Names can use letters, numbers and underscores, must not start with a number, and can be up to 40 characters.
3. Add the fields to your link as `?name=value`, joined with `&`.

A form can have up to 20 hidden fields. The embed code in the **Share** dialog includes each of them, ready for you to fill in the values.

## What happens to the values

- Values are saved with the response when the respondent answers their first question, and never change after that.
- Only fields you've declared are kept: anything else in the link is ignored. Values are trimmed and cut off at 500 characters.
- If the link has no value for a field, the response simply doesn't have one.
- Values survive the welcome screen and a [password](https://formhelix.com/docs/access#password-protection) page.

## Using the values

| Where             | How                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------- |
| **Responses**     | Each hidden field has its own column in the responses table and in CSV exports.                   |
| **Logic**         | Branch on a hidden field with is, is not, contains and doesn't contain. See [Logic](https://formhelix.com/docs/logic). |
| **Answer recall** | Show a value to the respondent with `{{hidden:name}}`. See [Answer recall](https://formhelix.com/docs/answer-recall).  |
| **Webhooks**      | Sent as `hiddenFields` in every delivery. See [Webhooks](https://formhelix.com/docs/webhooks).                         |
| **Endings**       | Pass a value on in a redirect link. See [Endings](https://formhelix.com/docs/welcome-and-endings#redirecting-instead). |

## Hidden fields in embedded forms

When you [embed](https://formhelix.com/docs/embedding) a form, set values with the `data-formhelix-hidden` attribute, or tick **Fill hidden fields from the page's own link as well** so that a page opened as `?source=ads` passes `source` on to the form.

> [!NOTE]
> Anyone can edit a link before opening it, so treat hidden field values as a hint, not proof. Don't use them to decide who may see something. If the form is [encrypted](https://formhelix.com/docs/encryption), hidden field values are encrypted too.
