Building forms
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://hootform.example/f/3b1c…?source=newsletter&customer=4812
A form with hidden fields source and customer stores newsletter and 4812 with that response.
Adding hidden fields
- Open the form's Settings tab and choose Hidden fields.
- Add a Field name. Names can use letters, numbers and underscores, must not start with a number, and can be up to 40 characters.
- 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 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. |
| Answer recall | Show a value to the respondent with {{hidden:name}}. See Answer recall. |
| Webhooks | Sent as hiddenFields in every delivery. See Webhooks. |
| Endings | Pass a value on in a redirect link. See Endings. |
Hidden fields in embedded forms
When you embed a form, set values with the data-hootform-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.