Skip to main content
All CollectionsBuild & customizeCreate forms
How to use a variable field with a formula
How to use a 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 over a week ago

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, etc.

Let's take calculating a circle area for our example. The form will calculate the circle area based on the formula and the radius “variable” entered by the user. The form includes variables, logic, and calculation to give the right answer automatically, based on the users’ answers.

For this, we should add 3 fields:

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

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

  • Content field - to see the calculation value on the form or app

To create a form with those fields, open your dashboard and create a new form. Now click on "+ Add new field" to add fields to your form.

For the variable field, choose the type of variable as a formula and add an ID "area" to it.

🗄️ Old dashboard:

variable field

For the variable fields' Default Value, you can write the formula that you want to calculate and use in your form.

In this case, we will write "radius*radius*3.14159265359" because of the formula

A=(r*r)π.

🗄️ Old dashboard:

circle area calculation

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 content 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 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:

🗄️ Old dashboard:

Here are tutorials for old dashboard.

Did this answer your question?