Duration field

Last Updated: Apr 24, 2019 01:14PM CET
The duration field is used when carrying out DateTime related calculations such as subtracting, adding or multiplying, years, days, hours, minutes, seconds to a DateTime field. It helps form owners to effectively perform DateTime calculation using appropriate DateTime metrics. 
The duration field is located in the Builder > Advanced Input section of your form.

How to use a duration field;
Let's say you have a report form where you want to automatically calculate a worker expected return time from a break. You can do this using the duration field following the steps below;
  • Add the time-out field on your form. This should be a time field or date field depending on the data to be received. You can learn more about the date/time field and related options in this article.
  • Include your duration field, and select the preferred options/metric to be used in the calculation from the edit modal of the duration field. Also, you can add the default value. The default value is the value that is displayed on the field automatically (although your respondent can edit this value). This value can also be used for carrying out the calculation in this example such that the expected time-out inputted by your respondent will be added to the default value and the expected return time (which is the result of the calculation will be displayed on the form. If you will not like your respondents to edit the default value, you can also set the field to read-only such that they will see this value but will be unable to edit it. Alternatively, you can select the option to hide the field such that it is not displayed on the form. You can learn more about default values here.
  • In your calculation modal, which can be located by clicking on the "Add Calculation" field in the Builder > Advanced Input section of your form. Input your calculation such that duration field is added to date/time field. This means your value for the duration field is added to the value for the date/time field which will be inputted by your respondent.
  • Select another preferred field to display the result of the calculation.
  • Select the expected metric in which result will be displayed in. This is different from the metric you have selected in your duration field.

DateTime calculations are not done using a number field as the system can not automatically detect the preferred metric to be used for the calculation, hence it is advisable to use a duration field where you can specify the date/time related metric in which calculation should be carried out in. However, this does not specify the metric in which your results will be displayed. This should be selected in the calculation modal. See this article for more information on DateTime calculations.