Question Type: Duration Calculation and Duration Math

About

Duration Calculations and Duration Time-Based Math produce a Duration value based on the values of other answers. They are often used in timesheets or work orders to calculate time worked, or to estimate the amount of work needed.

The Duration Math specifically calculates the duration between two date/time entries, while the Duration Calculation is more flexible: it will calculate a duration based on other duration questions and/or numbers.

Both of these question types appear on a mobile device as a simple read-only duration question and will automatically update based on the answers to to the source questions. A sample is shown below on an iOS device:

2019-02-21-iOS-DurationMath01.png

If you need to display a date or time, use Date/Time Based Math.

Form Builder

In the Form Builder, the Duration Math and Duration Calculation question types appear as shown below:

2019-02-21-FB-DurationMath02.png

The Question Edit screen for these question types has three tabs: General, Properties, and Help OptionsClosed Help Options are ways to add help content, such as YouTube videos, web pages, text, or images, to questions in a form. Mobile users simply tap the help icon next to a question to see the help that the form designer provided.. This article will go through each of the tabs.

2019-02-21-FB-DurationMath03.png

General

Unique ID

The Unique IDClosed A Unique ID refers to the specific identifier of a question, form page, form section, or Data Destination. Unique IDs are used as reference points when pulling data for conditional logic, Analytics projects, Data Destinations, and Documents. is the reference for the question. For more information on Unique IDs, read: Overview: Unique IDs. It can either be auto-generated based on the question text, or customized.

Data Types

Data Types control what kind of information can be considered an answer to the question. The Duration Calculation and Duration Math question types only accept one Data Type: Duration.

Restrictions

Restrictions control how your mobile users interact with a question. They can be set on the question itself, or controlled by Conditional Logic.

Required Read-Only Hidden on Device Hidden in Reports
Duration Calculation ✓* 
Duration Math ✓* 

* The Duration Calculation and Duration Math question types cannot be made Required because they automatically take information from other questions without interaction from the mobile user. It is Read-Only by default for the same reason.

Properties

Properties allow you to set up your question in various ways.

Duration
  • Precision: Determines what unit of measurement is used (Hours, Hours and Minutes, Minutes, Minutes and Seconds, Seconds)
  • Min/Max Value: Set a value beyond which the form cannot be submitted.

Duration Calculation

The Duration Calculation uses the Calculation Builder, enabling form designers to build calculations using questions with numeric data types that come before it in the form.

2019-02-21-FB-DurationCalc01.png

Tip:If you don’t specify a Min Value, the minimum value defaults to 0 to ensure that the result is a positive number.

Note:

The Duration Calculator does not require a duration value in its calculation, but always attempts to output a Duration value based on the source questions. The form designer must verify that the selected questions are appropriate.

For example, you could, in theory, set up a duration calculation that multiplies a site temperature reading by the invoice number and deploy the form. The app would output a Duration value based on that calculation, but it the result would be meaningless.

Duration Math

Duration Math questions require two previous Date/Time questions to calculate the duration between them. Select which is the Start Date/Time question, and then select the End Date/Time question from the dropdowns.

2019-02-21-FB-DurationMath04.png

Note: Ensure you select the appropriate Precision reading for the usual span of time you expect this question to yield. For example, if your mobile users will be taking two Date/Time stamps in short succession (perhaps entering and exiting an inspection site), using Minutes may be a better choice for Precision than Hours.

Help Options

Adding "Help" content to forms gives mobile users access to support and other resources out in the field. Help content is available to users through a button embedded beside a question. Any question in the form can include a link to YouTube videos, web pages, or HTML-formatted work instructions.

For more information on Help Content, please read: Adding Help Content to Questions