Form Calculation is one of the advanced features of Jotform. You can perform calculations using the FormCalculation Widget or the Update/Calculate Field condition.
In this guide, you’ll learn how to perform calculations in the Input Table field using the Conditional Logic and output the result on a text box field within the same Input Table field.
Here’s a demo form you can check: https://www.jotform.com/222510651473045. The result would look like the below image:
Adding the Input Table Field
First, you should have the Input Table field in the form. Here’s how you can add that:
- In the Form Builder, click the Add Form Element button.
- Scroll down to Survey Elements.
- Click the Input Table field to add. You can also drag and drop it into the form.
- Set it up according to your preferred columns and rows. Here’s an example based on the above demo form:
Now that you have the Input Table ready let’s set up the conditional logic to calculate the values.
Calculating the Values in Input Table With Condition
In the above form, the 1st, 2nd, 3rd, and 4th columns are summed up into the 5th column labeled Total. Here’s how you can do that:
- Go to the Settings tab.
- Click Conditions on the left panel.
- Choose Update/Calculate Field from the logic options.
- Create your conditional logic according to the below GIF:
Repeat the same step for the other rows.
If you also want to perform calculations on the Input Table field with a checkbox or radio button input types, refer to this guide: How to Perform Form Calculation in the Matrix Field.
Send Comment:
5 Comments:
29 days ago
Hi guys, is there a way I can use this function to calculate a date change?
What I'm trying to achieve is for my customers to submit a start date, then for that date to automatically pre-fill an end date field 7 days later. The reason I need the date field is the form automatically goes to a table with a calendar view that displays the events start and end date, however I'm moving to having a fixed end date of 7 days later.
My other option is to limit an end date input field to 7 days or less later than the start date, if that is possible but I couldn't find a way to do it.
More than a year ago
Help
How do I add calculation values to each option in a dropdown box in an 'Input Table' like you do for a standard dropdown form element.
Standard Dropdown box you enter options ie - Car, Lorry, Bus
then you add the calculation value ie Car £5, Lorry £10, Bus £20
I do not see this facility in the Input Table settings
More than a year ago
Good day, I would like to sum the total column. The value is displayed in form builder, however when the form is displayed in tables the total is not shown. Is there a way to resolve this issue?
More than a year ago
Yes, please how can you autofill for all rows?
Response would be highly appreciated.
More than a year ago
How can you do this for all rows automatically instead of a condition statement per row?