How to stop time auto-filling on DateTime question when Date is selected

642
3
04-02-2020 08:51 AM
DataOfficer
Occasional Contributor III

I have a DateTime question in my survey form. This is a desktop version to be completed by users who cannot use the mobile version at the time of time of collection for any reason. Therefore, we do not want the DateTime field (survey start date and time) to be auto-populated based on the device's current date and time. The form loads with both parts of the DateTime question blank (Date and Time), but once the Date is entered, it automatically fills in the Time with the current time. How can I stop this? There is a high risk that surveyors will set the date, accidentally skip the time and end up with an incorrect time stored in the form.

0 Kudos
3 Replies
Shwu-jingJeng
Esri Regular Contributor

Hi Rob,

How did you publish your survey with? By Connect or web designer?

Either way you can consider to use two separated field types "Date" and "Time" input, instead of "DateTime" field type.

Both Connect and web designer allow you to use Date and Time separately and will force user to manually input both fields in the survey.

0 Kudos
DataOfficer
Occasional Contributor III

Hi,

It was published through Connect.
The reason I am using dateTime fields rather than separate date and time is that we need to calculate the difference between two periods: TimeOnSite and TimeOffSite (see below). These can be across multiple days, which is why a simple calculation between two times gives an incorrect output. 

Is there a way of forcing manual input in to the time part of the dateTime field?

typenamelabelcalculation
dateTimeTimeOnSiteSurvey start date and time
dateTimeTimeOffSiteSurvey end date and time
integerDurationTotal survey timeint((decimal-date-time(${TimeOffSite}) - decimal-date-time(${TimeOnSite})) * 24*60)
0 Kudos
Shwu-jingJeng
Esri Regular Contributor

Hi Rob,

As DateTime field is one control, there is no method you can disable the autofill on each individually. You may use the Hint to remind your fieldworkers to update the correct time but it's totally up to your fieldworkers' validation though.

There is another way to use Start/ End field but it captures the survey time, not the time actually spending in the field:

https://community.esri.com/groups/survey123/blog/2018/05/04/creating-a-field-with-the-duration-time-... 

0 Kudos