Adding calculation to your form

Last Updated: Jul 13, 2019 07:09AM CET

Calculating form field allows you to perform simple mathematical operations on your forms such as addition, subtraction, multiplication, and division. This feature is especially useful in order forms to display the total price of items selected, surveys, quizzes.

Supported fields for carrying out calculation in Formplus forms include - Short text field (only when it has been selected to receive number values), Number field, Labelled input, Single-select, Checkboxes, Radio Field, Image choice, Star option, Heart, and Scale field.
 

Adding The Calculating Fields in Your Form

To create a calculating form field, first, sign in or sign up to Formplus and then head over to the builder.
From the Drag and Drop Fields section
The form calculation field is found in the Input section of the Drag and Drop section of the builder page. Clicking on the Calculation field displays the calculation modal.
From individual fields
The calculation modal is also displayed by selecting the calculation section of the edit icon of supported fields for calculation.


 


The Calculation modal
 



The image above shows what the form calculator looks like. For a step by step guide on each function, please read the following step​
1. The modal contains all the
fields in the form that can be used in calculations.
2.
An input box is provided to display the fields you have selected to be calculated.
3. The Calculator.
4. Dropdown fields - This displays the fields on your form that can be used as a result field.
5. Box to select decimal places to which results should be displayed.
6. The "Add" button to include more calculations.
7. The "Cancel" or "Continue" button


Please note Supported fields for displaying results of calculated values are- Payments fields,  Short text field, Number fields, and Labelled input fields.

How the Form Calculator works
To start computing values on your online forms, kindly follow these steps:
-
Click on the “Add calculation” field or the calculation tab on a supported field to display the calculator.
- Select your preferred field for the mathematical operation you want to perform from the left side of the calculation modal. This displays the preferred field in the input box.
- Use your preferred symbols on the calculator to perform arithmetic operations. Such that the input box appears like this.


- After you have done this, select a field to display the result of your calculation from the "select a field to display results" below the calculator. Clicking on the dropdown displays the supported result fields on the form.
- You can also select the number of decimal places you want your result to be displayed in.
- Click on the "Continue" button at the bottom right of the modal to save the current calculation.




Calculation in Choice Options
First, you need to assign values to the options you have used in your choice fields before they can be calculated.
To do that; Select the box "Assign values to option fields?" This displays a section to assign values for the option you have included in the field.



Calculation in the Ratings section
For the fields in the Rating section, clicking on the "Assign Values To Option Fields?"
displays a section with a default value of 1. This multiplies what your respondents select by the number you add.




Calculation in the Table field
Calculation in the Table field can only be done with all supported calculation fields. You can also calculate the sum or average of your respondent total input in a table field by selecting the option. To learn more about calculation in Table field, Kindly see this article.

Calculation on payment fields
The Payment field is a result field for calculation, this means it is used to display results and not to calculate. The results obtained from the calculation of values in other calculating fields can be used to populate a payment field. With this, your respondents get to pay the result of the calculation you have set.

Once a payment field has been selected as a result field, you can not set a price on the payment field again as there is a prompt on the edit modal to show that the price is gotten from the calculated fields.

Things to note with the calculating form fields
- The result of the calculation is based on the BODMAS principle. This means that arithmetic operations are performed in the order - Bracket, Order, Division, Multiplication, Addition and Subtraction
.
- If there is no value assigned to a checkbox option, the result returned is 1.
- For fields in the Choice Options, if you make changes to the options after assigning values, you will need to reassign your values to fit the change.
- If your respondent does not input any value in a field used for calculation, the default value becomes 0.
- Have more questions on how to use this feature. Kindly contact us via support@formpl.us. We are open to suggestions and feature requests.


You can see the video below for a little demonstration on how to add simple calculation on your form.