Template variables allow you to insert dynamic information from your form and its submissions directly into your integration configurations. This is powerful for customizing webhook payloads, Discord embed messages, Slack notifications, and more. When configuring an integration (Custom Webhook, Discord, Slack) within Formora, you can use the TemplateVariablesGuide component. This interactive guide, usually accessible via a “View Template Variables” button or similar, shows a list of available variables. Clicking a variable in the guide often copies it to your clipboard for easy pasting into text fields within the CustomWebhookBuilder, DiscordBuilder, or SlackBuilder.

Common Template Variables

The following template variables are available in Formora for Custom Webhook, Discord, and Slack integrations. They can be used in payload templates, message content, embed fields, and other text-based configuration options.
The specific output of {{data_all_fields_formatted}} is adapted for each integration type: JSON string for Custom Webhook (unless you modify it), Discord-flavored Markdown for Discord, and Slack mrkdwn for Slack.
VariableDescriptionExample Usage (in JSON unless specified)
{{form_id}}The unique ID of the form."form_id": "{{form_id}}"
{{form_title}}The title of the form."form_title": "{{form_title}}"
{{response_id}}The unique ID of the submission response."response_id": "{{response_id}}"
{{submitted_at}}The ISO 8601 timestamp of when the form was submitted."submitted_at": "{{submitted_at}}"
{{data_all_fields}}A JSON string of all submitted field ID/value pairs (raw data)."all_data_raw": {{data_all_fields}}
{{labeled_data}}A JSON string of all submitted field label/value pairs."all_data_labeled": {{labeled_data}}
{{data_all_fields_formatted}}A pre-formatted text string of all fields and their values.For text-based messages or descriptions.
{{field:Your Field Label}}The value of a specific field, identified by its exact label (case-sensitive)."user_email": "{{field:Email Address}}"
{{field_id:your_field_id}}The value of a specific field, identified by its unique ID."product_sku": "{{field_id:product_sku_123}}"
{{ip_address}}The IP address of the submitter (if captured)."ip": "{{ip_address}}"
{{user_agent}}The user agent string of the submitter’s browser/client (if captured)."browser_info": "{{user_agent}}"
{{submitted_from_url}}The URL of the page where the form was embedded or hosted and submitted from."source_page": "{{submitted_from_url}}"
{{geolocation.country}}Submitter’s country (derived from IP, if available)."country": "{{geolocation.country}}"
{{geolocation.city}}Submitter’s city (derived from IP, if available)."city": "{{geolocation.city}}"
{{geolocation.region}}Submitter’s region/state (derived from IP, if available)."region": "{{geolocation.region}}"
{{geolocation.latitude}}Submitter’s approximate latitude (derived from IP, if available)."latitude": "{{geolocation.latitude}}"
{{geolocation.longitude}}Submitter’s approximate longitude (derived from IP, if available)."longitude": "{{geolocation.longitude}}"
{{utm:utm_source}}UTM source parameter from the submission URL (if present)."utm_source": "{{utm:utm_source}}"
{{utm:utm_medium}}UTM medium parameter (if present)."utm_medium": "{{utm:utm_medium}}"
{{utm:utm_campaign}}UTM campaign parameter (if present)."utm_campaign": "{{utm:utm_campaign}}"
{{utm:utm_term}}UTM term parameter (if present)."utm_term": "{{utm:utm_term}}"
{{utm:utm_content}}UTM content parameter (if present)."utm_content": "{{utm_content}}"
{{form_views_count}}Total number of views for this form (if tracked)."total_views": {{form_views_count}}
{{form_total_submissions}}Total number of submissions for this form."total_submissions": {{form_total_submissions}}
{{secret:YOUR_SECRET_KEY}}(Custom Webhooks - Header Values only) References a secret value you store securely in Formora (e.g., an API key). Example: Authorization: Bearer {{secret:MY_API_TOKEN}}. This variable is only for use in HTTP Header values and not for payload content or URLs to maintain security.Authorization: Bearer {{secret:API_TOKEN}}

Using Field Variables

When using {{field:Your Field Label}} or {{field_id:your_field_id}}:
  • Label Matching ({{field:Your Field Label}}):
    • This is case-sensitive and must exactly match the label of the field as it appears in the Formora Form Builder.
    • If a field label is changed in the form builder, you must update this variable in your integrations accordingly.
    • Example: If your field is labeled “Email Address”, use {{field:Email Address}}.
  • ID Matching ({{field_id:your_field_id}}):
    • This uses the unique ID of the form field. Field IDs are generally more stable than labels if you tend to rename field labels frequently.
    • You can usually find a field’s ID in the advanced settings for that field within the Form Builder (consult Formora’s form building documentation if needed).
    • Example: If a field has an ID contact_email_input, use {{field_id:contact_email_input}}.

Where to Use Template Variables

  • Custom Webhooks (CustomWebhookBuilder):
    • Payload Template: Extensively used to construct the JSON body sent to your endpoint.
    • Header Values: For dynamic headers, especially {{secret:YOUR_SECRET_KEY}} for authorization (e.g., Authorization: Bearer {{secret:MY_API_KEY}}). Other variables can be used for custom tracking IDs if needed.
    • Webhook URL (Query Parameters - Advanced): While the base URL should be static, you could append query parameters with template variables if your endpoint expects it, e.g., https://api.example.com/submit?form={{form_id}}. Use with caution.
  • Discord Integrations (DiscordBuilder):
    • Webhook Username & Avatar URL (Overrides)
    • Message Content (above embed)
    • Embed Title, Description, URL
    • Embed Author Name, URL, Icon URL
    • Embed Footer Text, Icon URL
    • Embed Thumbnail URL, Image URL
    • Embed Field Names and Values
  • Slack Integrations (SlackBuilder):
    • Webhook Username, Icon Emoji, Icon URL, Channel (Overrides)
    • Message Content (fallback text for notifications)
    • Block Kit elements in “Simplified” mode: Header text, Main content text, Field texts, Footer text.
    • Block Kit elements in “Raw JSON” mode: Anywhere within the JSON string where Slack supports text.

Best Practices

  • Test Thoroughly: Always use the “Send Test Webhook” feature in Formora after setting up or modifying an integration that uses template variables. Verify that they are replaced correctly and your receiving endpoint (or Discord/Slack channel) displays the data as expected.
  • Quoting in JSON Payloads (Custom Webhook):
    • When a template variable is expected to output a string value within a JSON structure, ensure the variable itself is enclosed in quotes: "key": "{{variable_producing_string}}" .
    • If a variable outputs a number or boolean, it should generally not be quoted: "count": {{variable_producing_number}}.
    • If a variable (like {{data_all_fields}} or {{labeled_data}}) outputs a JSON object or array itself, and you want to embed it directly into your payload, do not quote the variable: "submission_data": {{data_all_fields}}.
  • Handle Missing Data: Be aware that some data might not always be present (e.g., UTM parameters, geolocation, optional form fields). Your receiving endpoint or message template should be designed to handle null or empty values gracefully.
  • Security for Secrets: The {{secret:YOUR_SECRET_KEY}} variable is specifically for sensitive values like API keys and should only be used in HTTP Header values for Custom Webhooks. Do not place secrets directly into message content or general payload bodies.
By mastering template variables, you can create highly dynamic and informative integrations that tailor the data flow from Formora to your specific needs. Next, learn about Custom Webhook Integration.