Skip to main content
Calculate variables in your form

Calculate scores, totals, and recommendations based on user input. Use variables, logic, and answer piping to personalize results.

Updated over a week ago

1- Create a project

Once you go to the dashboard and click on + New Formaloo you can choose your project. For this tutorial, we will need either a form or a survey. Edit it and add different types of question fields in your form.

For this tutorial, we will be creating a self-grading quiz, therefore, we will need the following fields:

  • Short/long text fields - to gather basic information, like the student's name;

  • Single-choice fields - to add quiz questions;

  • Content fields - for section introductions, like Geography, History, Science and Math;

  • Variable fields - for calculating the score.

2- Add a score to each question

To calculate variables on your form, we will need Formaloo logic.

Click any field and go to the logic tab as it opens in the right sidebar. Then go to Advanced Logic. Click to add a condition on each question, Then deicide + Add and insert the score you want. Let's to 5 in this case.

This means that if the question is answered correctly, they will have 5 scores added to their science score.

Add a number to the score in Formaloo logic

🗄️ Old dashboard:

logic and calculation

3- Add variable fields to calculate and show the total score

As the user fills out the form, the Variable field allows the storage of calculated data, enabling efficient organization and analysis of user input.

If you have different courses, create your formula to calculate estimations, areas, and much more in variable fields.

You will need to create separate variable fields for different scores, as shown below. However, it's important to assign an ID to each of them.

When it comes to calculating the total score, you will still need a variable field and you have to choose Formula and put the sum of all scores under Default value, in this case, science_score + geography_score + history_score + math_score.

Also, add an ID for this field, so it can be answer-piped and shown on the success pages.

🗄️ Old dashboard:

You can see all the variables and IDs in this template: Online quiz

number field

4- Add total score to success message

You can add different success pages to show the total score after submission. The result of your quiz will be based on the total score.

To display the total score after submitting the form, you should add the total score ID to the success message.

In our example, the ID of the total score in the variable field is: total_score

So you can write it in the success message as: Your Total Score is {{total_score}} or @totals_score. Both options are acceptable.

Also, you can add other variables in a table or with any design you want.

Ending page with answer piping

You can also add another ending page by clicking on the + icon on the lower left side of the form/survey ending.

Add an ending page

🗄️ Old dashboard:

real time

Examples of calculation forms; Calculate your way to success

In addition to basic forms, there are many templates available that can perform calculations based on user inputs.

These calculation forms provide a more interactive and personalized experience for users and can be a valuable tool for businesses looking to improve customer engagement.

Order form and product recommendation

Create flexible pricing structures based on several variables, including size, quantity, and other user-defined inputs.

You can add “Variable” fields to calculate the total price. Write the formula for the “Default value,” which is the submission of chosen products.

Or click on logic, and go to advanced logic to connect products to your categories, and calculate the logic-based pricing.

Connect your forms with payment gateways (PayPal, Stripe, RazorPay, Square, and more), and allow users to choose the best option that works for their business.

🗄️ Old dashboard:

BMI test

To calculate the BMI result, you need to use “variable” fields and add the BMI formula.

A person’s weight and height are used in the BMI test to get their BMI score, which determines whether they are underweight, normal weight, overweight, or obese.

custom calculations

You can configure conditional logic to display several success pages based on the user’s BMI result in order to demonstrate that. you can use a list of all success messages and make the logical conditions that lead to each.

Estimation form

A great method to get your clients and yourself on the same page regarding the type and cost of a project is through estimate forms.

Additionally, automation makes it easier to produce precise and similar estimate forms that can be quickly updated.

To calculate the total price, use the “Logic” tab and set up a fee for each type of service. Then create your conditions and connect them to the price variable field.

Then add a “section” field to the end of your form and use answer piping to display the total price.

🗄️ Old dashboard:


Did this answer your question?