The Formula field is a hidden field that is not displayed on the published form. The field allows you to set up formulas and calculate a value using data that your respondents enter into different fields on your form. To display the result of the calculation, you need to use the piping functionality (@) in the Text form fields. One form can have multiple Formula fields. Example: your form calculates a room area using the data it collects from two form fields: Width, m and Length, m The screenshot below illustrates the Area Calculator setup. The round function allows you to round your formula result with specified precision — zero, one, two, etc. decimals displayed. For example, you are going to add numbers from two form fields and round the result of the calculation: Example 1: round(@field1 + @field2, 3)
This will return the result with three decimals. Example 2: round(@field1 + @field2, 0)
This will return the result with zero decimals. The ´round´ function is just one of the functions from the Math.js library that
is supported by AidaForm. To review the full list, please visit https://mathjs.org/docs/reference/functions.html Sometimes you may want to split your formula into several lines (separate statements or calculations) to make it easier to work with. Important: Use semicolons to separate statements!!! Example: to calculate the Net Promoter Score, we decided 1) to replace the
long field labels employed in the formula with assignments and 2) to split the
formula calculations into several parts. As a result, the calculations become easier to read and manage: Sometimes your formula may depend on the conditions laid upon the data entered
by your respondent. For such cases, you may set up calculations with
conditions. For example, you would like to create a Cleaning Services Price Calculator and
your prices depend on the area in sq.m of the house that needs cleaning: 1 - 20 m²: $20/m² Here you may use a ternary operator in the form of Condition ? A : B
, which
will evaluate to A if the Condition is true and B otherwise. Your formula field calculations may look like this: Or like this: To review the full list of available operators, please visit https://mathjs.org/docs/expressions/syntax.html For your convenience, we have created several examples of the calculators that
you can add to your AidaForm PRO account to review all settings and edit to
adjust them to your needs. The calculator employs multi-statement calculations, the round function and
logic jumps to direct users to different calculator pages depending on the
resulting score. Use the link to add NPS Calculator to your AidaForm account. The calculator employs multi-statement calculations and the round function. Use the link to add the BMI Calculator to your AidaForm account. Cleaning Service Price Calculator The calculator employs multi-statement calculations, conditional
calculations and includes an order page to generate orders for calculated
cleaning services. Use a similar calculator to collect contacts and generate leads. Use the link to add the Cleaning Service Price Calculator to your AidaForm account.How to Use the Formula field (PRO account)
The Formula field allows you to:
How to set up the Formula field and display the calculation result.
How to round your Formula field result:
How to make multi-statement calculations
How to make conditional calculations
20 - 80 m² $15/m²
80 m² and higher: $10/m²Sample forms with Formula fields to add to your PRO account and review settings: