Calculation Component

Adding calculations to your form is a great way to automate processes, such as estimating costs, calculating scores, or summing up user inputs. This guide will walk you through how to set up calculations in WhatsForm.

In this example, we’ll demonstrate how to create a simple form that calculates the total cost of selected items (eggs, bread, milk) and optionally adds the cost of a carry bag if the user chooses to include one. Here's how you can set this up.

Assign values

Begin the process by assigning prices to each option. Click on the three dots next to each option and choose Assign values.

Click 'Assign values'Let's say eggs cost 10, bread costs 20 and milk costs 15.

Click 'Yes No'Follow the same process for the second question. A carry bag will cost the user and extra 5.

Click 'Advanced'Add a Calculation

Find the Calculation component under the Advanced section.

Click hereTo configure the calculation, we first need to add the first question. You can either type @ or click on the icon to select questions. First we select the question asking for eggs, bread and milk.Click 'What would you like to get?'Click on the + icon, as we will be doing a sum operation. Then type @ and select the second question. The second question is about the carry bag.

Now we have a simple formula, which will add up the values of the respective option the user selects.

Click 'e.g. $, ₹, £'Add Prefix or Suffix

You can also prefix or suffix to indicate units in the calculator component. Here, lets add the $ sign as a currency symbol.

Including a Prefix will place it on the left, while a Suffix will appear on the right.

Click 'TitleCalculation@What would you like to get?+@Would you like a carry bag?PrefixSuffixShow in form'

Test your Calculation

Now that everything is ready, let's see how the calculation looks.

Here the calculator operation has been automatically performed when the user selected the respective options in the form.

Click 'Bread'



Still need help?

Contact us

Question Types