All Collections
Build & customize
Create forms
How to use variable field with a formula
How to use variable field with a formula

Use form variables for calculations, customize fields for an area calculator, and explore donation forms, quizzes, and BMI calculators.

Updated this week

Form variables stand in for hidden calculated values, can be bound to columns, and can be used as references in other runtime expressions like calculated value controls and rules.

There are different types of forms and templates that you can use for the variable field, like a personality quiz, area calculator, donation form, BMI test and etc.

To create a form with the variable field, open your dashboard and create a new form. Now, add a variable field from the editor page’s left menu.

Choose the type of variable as “Formula” and add an “ID” for your field.

variable field

In the “Default Value“, you can write the formula that you want to calculate and use in your form.

Let’s continue with the area calculator template that includes five formaloos. Each formaloo is designed to calculate the area of a particular shape. For example, the “circle area” form, calculates the circle area based on the formula and the radius “variable” entered by the user.

It includes variables, logic, and calculation to give the right answer automatically, based on the users’ answers.

Here we should add three fields:

  • A “Number” field to enter the radius of the circle with an ID as “radius

  • A “Variable” field to add and calculate the formula of circle area with an ID as “area

  • A “Section” filed to see the calculation value on the form or app

circle area calculation

Write the circle area formula as the default value: radius * radius * 3.14159265359

And add an ID as: area

To pass a variable field value to another field in the form, you should use the answer piping feature.

With answer piping, you can easily pipe the calculated amount of circle area in the section field. Just add the variable field’s ID inside the section field as: {{area}}

More examples of variable fields

You can find other examples of variable fields in our tutorials;

  • A donation form with a variable amount is one that uses the variable field to enter the payable amount of the donation.

  • The online personality quiz compares the score of your variable fields with the logic and connects the related personality type to your responses.

  • The BMI test with logic and calculation, is another form using variable fields to calculate the BMI value.

Templates:

Did this answer your question?