Skip to main content

How to dynamically pull form data into custom emails, PDFs, and AI prompts

Learn how you can use form data, responses, and variable values to personalize your custom emails, generate tailored PDFs, and power AI-generated messages.

Updated today

When you collect information through a form – be it respondents' details, their input and selected options, calculated quotes or scores – you might want to reuse this data dynamically in your follow-up emails or in the PDF copies you generate and send along with them.

Additionally, you might need to "feed" those details into your AI prompt on an ending page or within your email template, to let AI analyze responses and generate hyper-personalized messages for each respondent.

Formaloo lets you reference form data, fields' or variables' values directly in your custom email templates, PDF templates, and AI prompts – turning static messages into dynamic and keeping your communication personalized while automated.

💡 If you haven’t yet, check out these guides to get started:

Learn how to create custom email templates and PDF templates where you can reuse form data dynamically:

Learn how to create hyper-personalized messages with the help of AI – on your ending pages or inside follow-up emails:


How it works

In your form, you can assign IDs to fields or variables you'd like to pull the data from later. Then reference fields or variables in your template using an @ followed by an ID.

In the actual sent email or generated PDF, these references will be replaced with the actual values from fields or variables:

When adding variables to your templates, keep in mind:

  • Variables are case-sensitive, so make sure their IDs match exactly between your form and your templates,

  • Avoid adding extra spaces or characters around variables – for example, @Name or @ name won’t work if your field ID is name,

  • You can format variables (e.g., bold, italic, centered, or right-aligned) in your templates, but avoid applying code (<>) formatting or styles that could break dynamic rendering,

  • Always double-check your references across templates if you change a field’s ID or rearrange fields that are referenced by their order numbers.


How to reference form fields to display their titles or user input

You can dynamically pull the field data using the @ symbol followed by the field ID that you assign manually, or by the field's order number on the form.

🆔 Referencing fields by field IDs

In the form editor, you can click any field and assign a descriptive ID to it:

You can then use these IDs to pipe the fields' titles or values into your email and PDF templates, or AI prompts.

Example:

  • Let’s say you have a single choice field titled “Service type” with three options: Branding, Website redesign, and SMM,

  • If you assign the selected_services ID to this field, you can reference it as @selected_services in your email or PDF template to display the user’s chosen option dynamically:

@selected_services → Branding
  • If you’d like to display the field’s title, add the _title postfix to your reference:

@selected_services_title → Service type
  • Or combine both:

@selected_services_title: @selected_services → Service type: Branding

#️⃣ Referencing fields by order number

If your field doesn’t have a custom ID, you can also reference it by its order number in the form.

ℹ️ To find this number, open your form in the Editor, click the field, and look at the field properties panel on the right. The order number appears next to the field’s title:

Keep in mind that rearranging fields or adding new ones in your form may impact their order numbers. If you’re referencing existing fields by their order numbers in any templates, double-check that your references still point to the correct fields after making adjustments.

You can reference it using @field_# followed by _title or _value to display either the field title or the respondent’s input.

Example:

  • If “Service type” is field #8 on your form:

@field_8_title → Service type
@field_8_value → Branding

☝ Note that referencing a field like @field_# alone (without _title or _value postfixes) isn't supported.

⬇️ Referencing File Upload fields

When referencing a File Upload field, using its field ID (for example, @upload_brandbook) or its order number (for example, @field_17_value) will insert a direct download link to the uploaded file(s):


How to pull in and display variable values

Variables don’t have order numbers, so to pull in and display variable values, you will always need to refer to their IDs – using the @ symbol followed by the variable’s ID:

When you reference a variable, its current value will be displayed dynamically in the email or PDF – whether it’s a text snippet, an integer, a decimal number, or a calculated result from a formula variable.

Examples:

  • Let’s say branding_estimated_price is an integer or decimal variable to which you add different amounts with logic based on the selected services:

@branding_estimated_price → 2500
  • Let’s say you have a formula variable with ID introversion_score calculating introversion score/total score*100 – in this example, the result calculated by the formula is 50:

@introversion_score → 50

💡 When pulling in variable values, you can include currency or percentage symbols directly in your templates to display values properly. For example:

$@branding_estimated_price → $2500

@introversion_score% → 50%

This way, the symbol appears together with the dynamically pulled-in value, making it easy to display amounts or percentages correctly.


How to pull in and display form details

In addition to referencing individual fields, you can also reference general form data variables to display form-level information dynamically:

  • @form_logo → displays the form’s logo, if it's been added to the form,

  • @form_title → displays the form’s title,

  • @form_description → shows the form’s description,

  • @form_full_address → inserts the public link to your form:

💡 When these variables come in handy:

  • Add @form_full_address when you want respondents to easily revisit or share your form – for example, as part of a referral or feedback program,

  • Use @form_logo when you want to automatically display your branded logo in emails or PDFs for a consistent, professional look,

  • Add @form_title to your email subject, helping you distinguish new submissions by form.


How to pull in and display order data in payment forms

If your form includes payments, you can also reference order-related variables to display payment details in your follow-up emails or PDFs.

These variables can help you confirm transactions or provide order summaries automatically:

  • @order_status → displays the payment or order status pulled in directly from the integrated payment processor (e.g., Stripe),

  • @order_code → shows the unique order code associated with the transaction,

  • @payment_amount → displays the total payment amount submitted via the form.

💡 These variables can be useful when you want to send automatic payment confirmations, receipts, or summaries. For example, you can include a line like:

Your payment of @payment_amount has been successfully received. Your order code is @order_code.


How to include full submission data (all or answered fields)

If you’d like to include a full submission copy in your email or PDF template – for example, to send it to your team or share it with the respondent – you can use two system variables:

  • @results_table
    Will display all input fields from the form along with each respondent’s input or selected options, formatted as a table:

  • @answered → d
    Displays only the fields that were actually answered, along with the provided responses:

These variables are ideal when you want to send detailed recaps, submission receipts, or data overviews without manually referencing each field. You can use @results_table to send your team a full submission record for review, and @answered when sending a simplified copy to respondents with only their completed answers.

☝ Keep in mind that these variables include only form fields and the answers submitted – they don’t include any variable values calculated within the form.

💡 If you’re using AI, the @answered variable is a great way to feed the entire form context to AI. It includes both the questions and the respondent’s answers, allowing AI to generate responses or summaries based on the full submission data.


Additional submission-related variables

Along with field and variable references, you can also use several submission-level variables to include extra details in your emails or PDFs:

  • @user_email
    Pulls in the respondent’s email address. This works if your form includes at least one Email field. You can also give your Email field a custom ID and refer to it directly. If there are multiple email fields, this variable automatically detects and uses the first one.

  • @created_at
    Pulls in the exact date and time when the submission was created or submitted.

  • @tracking
    Will display the row’s tracking number, if you’ve enabled the tracking code functionality on your form. Each submission gets a unique tracking code that can help your team or respondents easily identify and follow up on specific entries.

  • @rowid
    Will show the incremental row ID of the specific submission. This can be useful in team notifications to help locate the exact row in the project's responses table.


On attaching PDFs to emails

Previously, you could attach PDFs to your emails using the variable @pdf_link. This method will soon be deprecated.

Now, instead of using @pdf_link, you can attach PDFs directly in your custom email template settings by enabling the Attach PDF toggle and selecting the PDF template you’d like to include. This approach ensures smoother performance and easier management of your templates:

💡 For step-by-step instructions, check out our detailed guide on how to generate and send custom PDFs with your emails


{{}} → @


Previously, variables in templates were supposed to be wrapped in double curly braces – for example, {{name}}.

While this format is still supported, we recommend using the @ followed by the field, variable, or system variable ID (for example, @name) to ensure full compatibility and smooth performance.


Bottom line

Using field, variable, and system references lets you build fully dynamic, personalized templates. You can include just the details that matter, and keep every message clear and relevant.


You can also feed these references into AI prompts to give the AI clear context, ensuring each generated message is tailored and precise.

Did this answer your question?