Skip to content

Build

Variables and templates

Email recipients, subjects and messages, chat messages, Set values and Ask AI instructions can all use the answers of a submission. Write a field key in double braces and Formpik fills it in for every submission.

On this page you will learn

  • The template syntax, fallbacks and stored values
  • How every kind of answer reads
  • System values like the form name and the date
  • Values made by Set values and Ask AI
  • Which settings take templates, and what the webhook sends instead
  • The safety rules for auto-replies

Syntax

WriteYou get
{{key}}The answer of the field with that key, as people read it.
{{key | fallback}}The fallback when the answer is empty or the key is unknown.
{{key.value}}The stored value of a choice field, such as 50k_plus, instead of its label.
{{form.name}}A system value, listed below.
{{ai_summary}}A value made by an earlier Set values or Ask AI step.
  • Keys use letters, numbers, underscores and dots. Spaces inside the braces are fine: {{ name | there }} works.
  • A fallback is plain text and cannot contain a closing brace.
  • There are no conditions, loops or filters. Use Set values to prepare a value, or If / else to send different messages.
  • In any template setting, the variable menu inserts a variable at the cursor, grouped as Fields, Values and Submission.

Examples, rendered

These templates are rendered by the same code the flows use, for a Quote request submission from Ana Ruiz who left the company empty:

TemplateResult
Hi {{name}}Hi Ana Ruiz
Hi {{ name | there }}Hi Ana Ruiz
{{budget}}$25k to $50k
{{budget.value}}25k_50k
{{company | no company given}}no company given
{{service}} for {{company}}Website for
{{form.name}} via {{source.domain}}Quote request via yourcompany.com
{{submission.date}}Nov 20, 09:30 UTC

How answers read

  • Choices read as their labels, lists as labels joined with commas.
  • Yes or no reads as its button label, and a country as its name.
  • Ratings and scales read as "4 of 5" and "9 of 10". Amounts read with their currency after the number, such as "2500 EUR".
  • Date and time reads with a space instead of the T. A consent field reads as Yes or No.
  • File uploads read as the file names.
  • Answers to keys that are not fields of the form read exactly as they were sent.

The Field types page shows every type side by side.

System values

VariableValueExample
{{submission.all_fields}}All answersOne line per answer, see below
{{form.name}}Form nameQuote request
{{source.name}}Source nameMarketing site
{{source.domain}}Source websiteyourcompany.com
{{submission.date}}Received atNov 20, 09:30 UTC
{{submission.id}}Submission IDsub_7hq2xk

{{submission.all_fields}} lists every answer as "Label: answer", in the order of the form, followed by keys the form does not know. Empty answers, layout blocks and keys starting with an underscore are left out. For the example submission:

submission.all_fields
Your name: Ana Ruiz
Email: ana@example.com
What do you need?: Website
Budget: $25k to $50k
Project details: We are relaunching our marketing site in March and need design and build. About 12 pages, with a blog.

Test runs in the flow editor have no source, so the source name reads "Test submission" there. Dates are in UTC.

Values from steps

Set values builds new values from answers, such as a greeting or a combined name, and Ask AI saves its answer as a value. Both can be used in every later step by name, such as {{ai_summary}}, and they are listed under Values in the variable menu.

Set valuesTemplateResult
greetingHi {{name | there}}Hi Ana Ruiz
deal{{company | Unknown company}}, {{budget}}Unknown company, $25k to $50k

A value only exists after its step ran. Used on a path where the step did not run, it is empty, so give it a fallback.

Where templates work

StepSettings that take templates
Send emailTo, Cc, Reply to, Subject, Message
Reply to senderTo, Reply to, Subject, Message
Post to Slack, Teams, DiscordMessage
Set valuesEvery value
Ask AIText to read, and the instructions
Send webhookNone: the body is fixed JSON, see below

Route by answer and If / else do not use templates: you pick the field or value from a list.

Worked examples

Email to the team

A Send email step with Reply to {{email}}, behind an Ask AI step that summarizes:

Text
Subject: Quote request: {{name}}, {{budget}}

New quote request from {{name}} ({{email}})
Company: {{company | not given}}
Received {{submission.date}} on {{source.domain}}

{{ai_summary | No summary}}

{{submission.all_fields}}

The summary in the result is an example of what AI might write.

Auto-reply to the sender

A Reply to sender step. It uses only short answers, so nothing is left out:

Text
Subject: Thanks, {{name | there}}

Hi {{name | there}},

Thanks for asking about {{service}} with a budget of {{budget}}. We reply within one working day.

Your reference: {{submission.id}}

Slack message

Text
*{{name}}* asked for a quote: {{service}}, {{budget}}
{{ai_summary | No summary this time}}

Turn on Include every answer to list the answers under the message, so the template can stay short.

Webhook body

Webhooks do not take a template. Every webhook gets the same JSON: the answers as sent under data, and under values the readable answers plus every value from Set values and Ask AI. To send a value of your own, create it with Set values first. The example submission arrives like this:

JSON body
{
  "event": "submission.created",
  "submission_id": "sub_7hq2xk",
  "form": {
    "id": "frm_example",
    "name": "Quote request"
  },
  "source": {
    "id": "src_marketing",
    "name": "Marketing site",
    "domain": "yourcompany.com"
  },
  "received_at": "2026-11-20T09:30:00.000Z",
  "data": {
    "name": "Ana Ruiz",
    "email": "ana@example.com",
    "company": "",
    "service": "website",
    "budget": "25k_50k",
    "details": "We are relaunching our marketing site in March and need design and build. About 12 pages, with a blog."
  },
  "values": {
    "name": "Ana Ruiz",
    "email": "ana@example.com",
    "company": "",
    "service": "Website",
    "budget": "$25k to $50k",
    "details": "We are relaunching our marketing site in March and need design and build. About 12 pages, with a blog.",
    "ai_summary": "Ana Ruiz wants a new 12 page marketing site with a blog, designed and built before a March relaunch. Budget is $25k to $50k."
  }
}

Formatting and escaping

  • Emails are plain text. Formpik also sends an HTML version in which everything is escaped and line breaks are kept, so HTML in a template or an answer shows as text and never as markup.
  • Subjects keep to one line: line breaks become spaces.
  • Slack messages use Slack formatting, so *bold* and _italic_ work in Slack.
  • Discord messages never ping anyone, because mentions are switched off.
  • An unknown variable renders as nothing, or its fallback. Go live flags variables that are neither fields of the form nor values from a step.

Auto-replies stay safe

Reply to sender emails go to an address the visitor typed. Without limits, anyone could type someone else's address and their own message and use your form to send it. So in a Reply to sender step:

RuleEffect
Long free text is left outLong text, address, website and file answers render empty, and so does {{submission.all_fields}}.
Short answers are cappedEvery other answer, and every value from Set values and Ask AI, is cut after 80 characters and ends with "...".
Unknown keys render emptyKeys the website sent that are not fields of the form are left out.
One recipientOnly the first valid address gets the email, with no Cc.
3 emails a dayAn address typed into a form gets at most 3 emails a day. Further ones are skipped and the step says so. This also applies to Send email steps whose To uses a variable.

Common questions

Why is my variable empty?
The key must match the field key exactly, the answer may be empty, or it is a long free text answer in an auto-reply. Add a fallback to see the difference in a test run.
Can I write HTML in an email?
No. Emails are plain text with line breaks kept, and HTML shows as text.
How do I get the stored value of a dropdown?
Add .value to the key: {{budget.value}} gives 25k_50k where {{budget}} gives "$25k to $50k".
Do fallbacks work with system values and AI values?
Yes, a fallback works with every variable, such as {{ai_summary | No summary}}.
What happens to my templates when I rename a field?
Every template in the flows of that form is rewritten to the new key, fallbacks and .value included.

Next steps