Skip to content
FormFlow

Pre-fill a Form from its link and carry a campaign source

Open a Hosted page with answers already filled in from its link, and carry a campaign source such as utm_source in a Hidden field. Steps, rules, and the privacy trade-off of values in a URL.

Screenshot of a FormFlow Hosted page opened from a link that carries answers. Full name, Email address and Subject are already filled with a seeded sender, Lena Ortiz, and nothing is sent. It shows the pre-fill the tutorial sets up through the link.

A link can open a Form with some answers already in it, and it can carry a value the person never sees, such as the campaign that sent them. Both arrived in v1.12.0. This tutorial shows how to set each up on a Hosted page, then covers the limits: what a link cannot fill, why a link is not a safe place for personal data, and what to do on an Embedded form, where the link is not read at all.

What you need

A Form with a published Hosted page. The Publish a hosted page switch on the Hosted page tab is locked with the note "Hosted pages are available on paid plans." The same query-string rule applies to a Form block on a Microsite page, which the Microsites post describes. A link fills a field by its Name, the string the HTML input posts under, not by its Label. Open the Fields tab and check the Name of each field you plan to fill.

  1. On the Fields tab, note the Name of the field. For this example, a field named email.

  2. Open the Hosted page tab and make sure Publish a hosted page is on. Beside "Live at" you will see the page's address. Copy it.

  3. Add a question mark and the field's Name, an equals sign and the value to the end of the address. Join more pairs with an ampersand.

  4. Open the finished link in a private window. The field should already hold the value.

YOUR_HOSTED_PAGE_ADDRESS?email=ada@example.com&topic=Sales

Here YOUR_HOSTED_PAGE_ADDRESS is the address after "Live at", and topic is the Name of a Select field with a Sales option. A few rules decide what actually gets filled:

  • A Pre-fill is only where a control starts. The person can change anything they can see, and nothing counts as an answer until they press Send. It is then judged exactly as a typed value is.

  • A Select, Radio or Multiselect takes a value only if it is one of the field's own options. Anything else is ignored.

  • A Checkbox takes 1. A Scale or Rating takes a whole number inside its range.

  • Duration, grid, checkbox grid and file fields are never filled.

  • A key that is not a field of the Form is ignored.

  • If the person has already sent answers and the page came back, for example after an error, their answers win over the link.

  • A Graded Form is never pre-filled, so a link cannot answer a paper in advance.

Carry a campaign source in a Hidden field

A Hidden field holds a value the person never sees or edits. It is how a campaign source, or a reference from your CRM, arrives with the Submission without cluttering the page.

  1. On the Fields tab, press Add field.

  2. Set Name to utm_source. Set Type to Hidden. Once you choose Hidden, the helper under Type reads "Filled from the link" and shows the form of link to use.

  3. Keep the field on the first step. A Hidden field must be on the first step, where no branch can skip it, and that step also needs a question the person can see, not only Hidden fields.

  4. Save the Form.

  5. Add the key to your link: YOUR_HOSTED_PAGE_ADDRESS?utm_source=newsletter. Open it, fill the visible fields and send.

  6. Open the new Submission. The value newsletter sits among its answers. FormFlow's changelog says it also reaches exports, Google Sheets and webhooks.

A Hidden field is never required and has no rules to set, because the person could neither see nor fix a refusal. Its name cannot be the Form's honeypot field. It is never printed back to the person on a screen that lists their answers.

Strict mode and Hidden fields

On the Security tab, the switch Validate submissions against the field list is Strict mode. With it on, a Submission must match the Form's field list, so a key the Form does not declare is a problem. Declaring a Hidden field is what lets its key through, so you can track campaigns without turning Strict mode off.

On an Embedded form

Pre-fill reads the link that opened a page FormFlow serves. An Embedded form lives on your own page, so FormFlow never sees that link. The generated component does include a Hidden field, as a bare input with no value. Filling it is up to your page. A minimal script, written by you and not generated by FormFlow, looks like this:

<input name="utm_source" type="hidden">

<script>
  var source = new URLSearchParams(location.search).get('utm_source');
  var input = document.querySelector('input[name="utm_source"]');
  if (source && input) { input.value = source; }
</script>

Place the script after the form. The input line is what the generated component contains for a Hidden field named utm_source. Strict mode still needs the Hidden field declared in the Form.

Limits to know about

  • The panel's preview never takes a Pre-fill. Test with the real link.

  • A Form that admits only a Roster sends people through a sign-in step, and a Pre-fill does not survive that redirect.

  • A Graded Form cannot have Hidden fields. The builder says so: "A form with an answer key cannot have hidden fields."

  • Every value in a link can reach your analytics and logs, whether or not it is a Hidden field.