How Can I Insert a Calculation Field into an Input Table with Dropdowns

  • Wolff_Power
    Asked on June 18, 2020 at 6:52 PM

    I want to add a calculation field inside my input table. Each line in my input table is for a staff member or piece of equipment, their start and finish times, breaks, and total hours (calculated field). I've tried the options section and inserted calculation values and I've tried the conditional logic sections as well which doesn't seem to work. 

    I can get it working using a separate calculation field but I want the calculation to be included in the table for ease of use. 

    Jotform Thread 2398495 Screenshot
  • Mike_G JotForm Support
    Replied on June 18, 2020 at 9:58 PM

    I have checked your form and the table you are referring to. To my understanding, you would like to find the difference between the Start hrs/mins and End hrs/mins columns less the value in the Break column and have the value selected in the Total Hours column.

    Please allow me some time to check for an available workaround that would meet your concern. I'll update you with my findings on this support ticket as soon as possible.

  • Wolff_Power
    Replied on June 22, 2020 at 12:48 AM

    Yes, that is correct, thanks - looking forward to your response. 

  • Mike_G JotForm Support
    Replied on June 28, 2020 at 7:52 PM

    To get the value for each cell under the Total Hrs column of the table you showed in your screenshot, you first need to convert the value entered in the Start Hrs, Start Mins, End Hrs, End Mins, and Break columns to seconds. You can do that through the Update/Calculate condition.

    You may use this guide as a reference: Calculate-Values-in-the-Input-Table-Through-Condition

    You would need to create the condition shown below for each row in your Input Table.

    1593387659zt200628 193235 Screenshot 10

    In the calculation, I converted the values in each cell I mentioned above to seconds then, in the same calculation, I converted it back to hours by dividing it by 3600 (seconds).

    Note: The calculation assumes that the value entered in the Start Hrs/Mins will be lower than the value entered in the End Hrs/Mins. This means that the calculation works only for time difference within the same day (not more than 24 hrs or 23 hours and 59 mins in your form's case)

    Here's a cloned version of your form. I have created the condition for the first two rows of the Employees & Equipment Input Table field.

    https://form.jotform.com/201797081463964

    Result:

    1593388207zt200628 194935 Screenshot 21

    I hope this helps. Feel free to let us know if you need any further assistance.