Variables act like invisible containers that store values while a user interacts with your form. You can set up logic to “drop” values into these containers to calculate percentages, scores, and other dynamic values based on what the user selects, types, or does.
You can then use this value to dynamically display it within your form, personalize the end results, and send tailored follow-up messages.
Types of variables and how to create them
You can manage all your variables in the Variables section of the Form Editor, and access each variable's settings upon clicking on it and turning to the right-hand panel.
Here's how you can add a new variable to your form:
Navigate to the Variables section, and click +Add to add a new variable
Choose the type, depending on what you'll be "putting into the container":
Integer
– for whole numbers (e.g. 1, 2, 3)Decimal
– for numbers with decimal points (e.g. 3.14)Text
– for text stringsFormula
– for mathematical expressions to calculate values dynamically
Give it an ID (to use the variable value in further calculations, or to display the value elsewhere in the form)
Give it a title (to easily tell one variable from the other in Logic)
Configure additional settings like default value (for Integer, Decimal, or Text), default formula (for Formula), or max number of decimal places (for Decimal or Formula)
💡 You can also create a new variable (Integer, Decimal, or Text type) on the go, right in Advanced Logic:
How to use variables (most common use cases)
Here are some examples of how variables are commonly used in Formaloo:
✔️ Adding points based on answers:
In math or qualification quizzes, you can add points for choosing the correct answers; in a personality quiz, each selected answer can add points to a specific personality type:
💡 When you're adding points to Integer or Decimal variables based on selected answers, it's important to set their default value to 0:
This will ensure that the variable holds a value of 0 (instead of "-") even if no points have been added to it, so it can be successfully compared in logic to other variables or a specified numeric value.
✔️ Calculating the total price for selected products/services:
For example, you can first add the costs of selected services, then multiply the cost by another input like the duration or the number of items the service applies to:
✔️ Calculating values from multiple inputs with custom formulas:
For instance, use Number fields for inputs like length and width, then calculate the floor area of a room via a formula variable, and display the result dynamically elsewhere in your form or use it in further calculations:
💡 To use variable values in another variable's formula, you need to assign IDs to each variable and refer to them in the formula by those IDs.
Example:
Assign room_area_m2 ID to your room floor area variable. In the price variable, use that ID right in the formula, like so:
room_area_m2*55 (where 55 is the static price per m2)
✔️ Using text variables to customize your messages:
Assign and store text snippets in variables based on the user's input in your form. This helps create dynamic, tailored content and personalize parts of a message by piping variable values into it, instead of writing separate messages for every possible user choice:
Combine & layer variables for more complex calculations
You can layer variables together to build more advanced logic and calculations.
In a price estimation form:
Calculate the cost of service A based on how many items it applies to (e.g. SEO for 2 sites),
Calculate the cost of service B based on duration (e.g. Marketing for 3 months),
Calculate the total price by summing the cost of 2 services with an additional formula variable:
Or in a qualification quiz:
Track a user’s score by adding points to a variable whenever the correct answer is selected,
Use a second variable to divide the user's score by the maximum possible score and show the result as a percentage:
💡 For detailed examples of how to use variables and logic in your forms, check out these articles with templates to help you get started:
BMI Calculator using variables and logic: Learn how to calculate and categorize BMI using variables and logic.
Personality Quiz using variables and logic: Explore how to create dynamic personality quizzes with variable-based logic.
Estimation Form using variables and logic: Discover how to build an estimation form that calculates costs based on user inputs.
These templates will guide you through setting up and applying variables and logic for various use cases, providing personalized and interactive form experiences.
Trigger personalized flows based on variable values
Variables can power logic that adapts your messages, actions, or follow-ups based on users' preferences or scores.
You can compare variable values to a specific threshold (e.g., less than 15), or to each other (e.g., to check which variable scored the highest). This enables you to:
Send the user to a tailored ending page at the end based on variable values:
Send tailored follow-up emails (e.g., with relevant product suggestions):
Redirect to relevant URLs (e.g., send users to a specific product page or landing page based on their quiz result or form input):
📝 Additional insights:
To further enhance your understanding and improve the functionality of your forms, you can visualize variables and use the logic map to track how they interact throughout the form. This allows you to better manage and refine dynamic user experiences, ensuring all logic is executed smoothly.
Display variable values in your form and follow-ups with answer-piping
Use answer piping to personalize your messages and follow-ups. Simply assign an ID to any variable, then use an @ (at-sign) and variable ID to pipe the variable's value elsewhere:
For example:
Total price of the selected services is $@total_price.
You scored @final_score points out of 150!
Based on your answers, you are @introvert_score_percent% introverted.
You can dynamically display the variables' values:
in other fields' titles and descriptions,
on the ending pages,
in custom email templates:
or even "feed" the variable value to AI in an AI Smart Content prompt:
💡 Learn how to create different success pages and use logic to redirect users based on their answers.
💡 Learn how to automate actions with On Update logic – not just when a form is submitted, but whenever a response is updated.