Calculation Widget: Is there an easy way to do all of these calculations?

  • joanfeldman
    Asked on November 15, 2018 at 1:02 PM

    Before I start putting in 90 items for calculations, is there a better way to do this?

  • DonaldHag
    Replied on November 15, 2018 at 3:50 PM

    Yes, there are ways you can reduce the number of calculations and conditions required for your form as follows;

    1. Use the assigned calculation values to come up with the total. To achieve this, add the sub-total as a Calculation Field and input one formula to calculate all the options. Note that the one formula will work even if some options are not selected. They will be calculated as a zero. The calculation for the total will be something like: (Student 1: Wednesday option + Student 1: Thursday option + ... + Student 2: Wednesday option + ... ). Refer to this guide: https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget

    2. Add multiple conditions together to form one condition. There is an option to hide/show multiple fields in the same condition. This way you do not have to create separate conditions to show/hide each item in the form. In addition, there is a plus (+) sign you can select in the conditions allow a single condition to affect multiple fields. 

    1542314339Selection 285 Screenshot 10The methods above will help you reduce the number of conditions. Please let us know the specifics of how you would like the form to function and we can assist you to reduce the number of conditions required.

    Other workarounds to this include;

    - If you intend to add the products to a Payment Widget, you can add them directly and add pricing options such as quantity, size, date, number etc. Using this method you would have to modify the way the form works and have the students added separately and then the products selected separately from the payment Widget. Refer to this guide: https://www.jotform.com/help/225-How-to-Add-Options-to-Payment-Forms

    - Using the input table and performing the calculations within the table. In this case, you can have all the choices for each student in a table and then add a condition to calculate the total from their selections within the table. Note that the input table can have the option of just ticking the option they like and the total gets calculated based on their selection. Refer to this guide: https://www.jotform.com/help/414-Calculate-Values-in-the-Input-Table-Through-Condition

    - Using the Configurable List Widget. This option will allow adding multiple fields and give the user the option to add more fields dynamically reducing the number of conditions required, however, the totals cannot be calculated using this Widget. Conditions cannot be used with this Widget. 





  • joanfeldman
    Replied on November 15, 2018 at 4:00 PM

    Thank you. We use this form for parents to pre-order lunches for their children for the entire month.

  • arthurprc
    Replied on November 15, 2018 at 5:25 PM

    Hi Joan, 

    Sounds good! Let us know if you need further assistance to customize it, I've cloned your form and checked your Form Calculation widget and it looks correct, just need to add the remaining fields.

    Don't hesitate to ask for help anytime you need, our team provides 24/7 support.

  • joanfeldman
    Replied on November 16, 2018 at 8:33 AM

    I am not sure I completely understand how to do the calculations so I don't have to do 90 of them. Can you please show me?

  • joanfeldman
    Replied on November 16, 2018 at 10:00 AM

    Maybe a more accurate question is do I have to input all 90 or so options into the formula?

  • DonaldHag
    Replied on November 16, 2018 at 11:31 AM

    Yes, this is correct. Each student has 17 options to select food and there are 3 students. That makes 51 options. So in the calculation Widget, you have to add the 51 options to the formula. When an option is not filled, it will not be computed in the formula so the total will remain accurate.

    1542385674calculation2134 Screenshot 10

    And then have conditions to show or hide fields based on whether the Parent selects add another student. 

  • joanfeldman
    Replied on November 16, 2018 at 11:49 AM

    So there is not a way for me to NOT have to put in all of those calculations? Would there be an easier way to do the form to make this part easier?

  • arthurprc
    Replied on November 16, 2018 at 1:11 PM

    Hi there,

    Unfortunately, we don't have a feature to add multiple fields to the calculation at once in the current JotForm version.

    We've added a feature request for this, though it would not be possible to define an ETA for the update.

    Let us know if you need further assistance in the meantime, you'll be notified if we add this feature in future updates.


  • joanfeldman
    Replied on November 16, 2018 at 1:53 PM

    Thank you!