Adding a running counter that spans form submissions

  • bkrills
    Asked on October 19, 2018 at 8:17 PM

    I'm trying to build a form that displays total out-of-service days for gear that's been down for greater than one day.

    What are my options to add a field with that goal in mind? Could the form pull info from the last time that a vehicle was marked out of service to create a days out counter on the results?


  • Mike_G JotForm Support
    Replied on October 20, 2018 at 1:22 AM

    I'm not sure I completely understand your requirements and we may need to ask for more information about it. But if you are looking to display the number of days a gear is out-of-service if it's been out-of-service for more than a day, then you can do the workaround below.

    You will need 2 Date fields — The first one is set to have the current date

    1540012133t01 08 10 Screenshot 10

    and the other one will have a custom date which will be the date the gear is first out-of-service.

    1540012240t01 09 14 Screenshot 21

    You will get the difference of the value of the two date fields and display it on the form if it is more than 1 day. This will be done conditionally.

    You will need a Form Calculation widget to get the difference between the two date fields.

    1540012425t01 12 47 Screenshot 32

    Here's how it works.

    1540012671t01 17 26 Screenshot 43

    After that, create a condition that will show the Form Calculation widget if its value is more than 1.

    1540012859t01 19 39 Screenshot 54

    Note: The value of the second Date field that is set to have a custom date value will be updated by you on the form builder.

    I hope this helps. If, in any case, I have misunderstood your concern, please feel free to letus know.