Time Calculations in Seconds in Survey 123

602
4
12-12-2018 06:51 AM
Highlighted
New Contributor II

Am looking to do time calculations in survey123. i have a form where am collecting behavior observation data on elephants. One piece of data is Out of View which needs to be displayed as a sum of total seconds when an elephant was out of view. Am having trouble figuring out how to display the time in seconds between observations. I am only able to display seconds in multiples of 60. ie 60, 120, 180 etc. How do you format the date time to display all seconds e.g 64, 118 etc and not in multiples of 60 seconds. It would have been great to have the capabilities of a stopwatch/ timer available in the survey from. 

Reply
0 Kudos
4 Replies
Highlighted
Esri Esteemed Contributor

Hi Vincent,

The time controls in Survey123 have a resolution of 1 minute.  To record seconds, you would need to provide a numeric input (likely in a repeat to support multiple observations).

Reply
0 Kudos
Highlighted
New Contributor II

Hi James

Thanks for your feedback. Does this mean i can only display the seconds in multiples of 60 seconds ? What i needed was to be able to read the seconds in between the 1 minute resolution as you say directly from the system time and have it displayed. I this possible with the app? Thanks

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Vincent,

Automatically measuring time in seconds isn't directly supported in Survey123.  It can be done by using the now() function in 2 questions to get timestamps.  By clearing out and recalculating the values, you can create a counter.  See the attached form.

Reply
0 Kudos
Highlighted
New Contributor III

Dear James,

Regarding measuring time in second you attached the Excel sheet it was not clear for me how it measures !!

because i use " ${task_order_organization_code} + '-NTS-' + format-date(${nts_date},'%Y%m%d') + '-' + format-date(${nts_time},'%H%M') " for ID reports to not get duplicate ID but now i see if two field reporters open the survey at the same time we will get duplicate ID so we need add second for ID as well to not get duplicate ID.

any suggestion it will be appreciated 

Reply
0 Kudos