How to perform calculation in Input Table

  • ArmaniRestaurant
    Asked on July 24, 2024 at 8:04 PM

    Hello,

    Could I add a table to a form which performs row calculations?

    Thank you

  • Hilary JotForm Support
    Replied on July 24, 2024 at 10:50 PM

    Hi Armani,

    Thanks for reaching out to Jotform Support. I'll need more time to look into this. I'll circle back in this thread when there's an update.

    Thank you for your patience.

  • Hilary JotForm Support
    Replied on July 25, 2024 at 1:15 AM

    Hi Armani,

    You can use Input Table and perform calculation there. Let me show you how to add the Input Table:

    1. In Form Builder, click on Add Form Element.How to perform calculation in Input Table Image 1 Screenshot 50
    2. Drag and drop Input Table to the form.How to perform calculation in Input Table Image 2 Screenshot 61

    Now, you can set calculation formula in the Input Table.

    1. In Form Builder, click on Input Table’s gear icon to open properties.
    2. In the properties panel on the right, go to Options at the top.
    3. Enter your calculation values according to your table’s dimensions.
    4. Separate the values with commas for columns and break lines for rows.Steps to add Calculation Values in Jotform Form Builder's Input Table Screenshot 72

    Finally, add a Form Calcation Widget to your form.

    1. In Form Builder, click on Add Form Element.How to perform calculation in Input Table Image 1 Screenshot 50
    2. Go to Widgets section.
    3. Drag and drop Form Calculation to the form.How to perform calculation in Input Table Image 4 Screenshot 94
    4. Select the widget’s wand icon to open settings.
    5. In the settings panel on the right, select Add Field, then choose your Input Table.Steps to add an Input Table in Form Calculation widget Screenshot 105
    6. Choose your table’s sub-fields to use in your calculations, then select Done at the bottom.Performing Calculations With Input Table Image 1 Screenshot 116
    7. This will add the sub-fields in the calculation editor without operators. Sub-fields are either the rows or cells in your table, depending on the input type.Performing Calculations With Input Table Image 2 Screenshot 127
    8. Complete your formula in the editor, then select Save at the bottom once you’re done.A calculation example to get the sum of all sub fields in Input Table Screenshot 138

    Give it a try and let us know if you need any other help.

  • Kusai
    Replied on July 25, 2024 at 8:05 PM

    Thanks you for the instructions, but that does not totally help me. I want to be able to enter variables values in the tables fields and then perform a simple calculations on them. The report I am trying to build is a store daily sales report, so the fields values would be different from day to day. Please see bellow the table I did on Excel and let me know if I can duplicate something like that in the form. Thank you.


    How to perform calculation in Input Table Image 1 Screenshot 20

  • Mary Eden JotForm Support
    Replied on July 25, 2024 at 10:34 PM

    Hello Kusai,

    Please note that your Table is possible, however, for the Total Cash and Card, we need to use a Form Calculation Widget to get the total sum, similar to the suggestion provided by my colleague. Let me show you how it's done:

    1. Add the Input Table along with the description. For the card and cash, we will use two separate input tables. 

    How to perform calculation in Input Table Image 1 Screenshot 40

    2. To determine the sum of these two tables, we will use the Form Calculation Widget.

    How to perform calculation in Input Table Image 2 Screenshot 51

    Check out the screencast below to see my results:

    How to perform calculation in Input Table Image 3 Screenshot 62

    Give it a try and reach out again if you have any other questions.