Here are the steps to populate the value of a field dynamically based on the value of other fields, (or based on a mathematic equation).
First make sure you have added all the fields you would like on the form. For example below we have created a basic order form for a fruit shop. It has two "Select" lists for the quantity on the left, and three text fields on the right which will be our "Calculated" fields.
For our "Quantity" select lists we have populated them with numeric values of 1 to 10. These numeric values will be used in our equations later on.
When you click on a field you will notice that each field has a unique "Name". It is these name that you can use in square brackets in your calculations. e.g. [Field_Name_1] + [Field_Name_2] * [Field_Name_Three].
For example the "Bananas" quantity field above has the name gp_form_field_1601555678719, . Each banana is 80 cents in this example, so if we wanted a field to display the total cost of all bananas we would use the equation:
[gp_form_field_1601555678719] * 0.8
If we also wanted the figure to always be shown in two decimal places, we could add (decimal:2) at the end of the equation, so the final equation we need for the Bananas "Sub-Total" field would be:
[gp_form_field_1601555678719] * 0.8 (decimal:2)
You can use addition (+), subtraction (-), multiplication (*), groupings using brackets, and use either field names, or fixed numbers to make your calculations. For example you could add two fields values together, then add 10% GST to the total like this:
( [gp_form_field_1601555678719] + [another_fields_name] ) * 1.1
Just like in mathematical equations, you can use brackets to group calculations, for example above we are adding two fields together, then only after they are added, we multiply by 1.1:
Now where do you actually put your equations? The location is in the "Calc Fields" module on the right menu bar, that looks like this:
When you click on this it should open a popup window asking you to specify what equation you would like to be used for which fields. For example below I've said that the "Sub Total" field for bananas is the banana quantity fields value , multiplied by 0.8, and I wanted the result to be displayed in two decimal places.
When you are done entering the equations for your calculated fields, then press the "Save Changes" button.
When you view your form now by clicking the eye icon, you will see the calculated fields working.