Dates and Time in Survey123

108047
107
04-17-2016 10:00 AM
IsmaelChivite
Esri Notable Contributor
27 107 108K

 

[Updated June 16, 2020]

[Updated September 18, 2023]

[Updated October 25, 2023]

 

Note: In October 2023, ArcGIS Online introduced new date and time field types. We will add support for these new fields in Survey123 in 2024.  This article will be updated accordingly once we have support for the new field types. Until then, everything below applies only to esriFieldTypeDate.

 

In this blog post I will describe how you can work with dates and time in Survey123 with XLSForm. I will also cover important concepts for you to understand how dates and time are modeled in ArcGIS.

 

Before we start

To best follow instructions and concepts in this blog, I suggest you open the Dates & Time survey sample in Survey123 Connect. If you have a first look at this sample survey, it will much easier for you to follow content in the blog.

 

  1. Open Survey123 Connect
  2. Tap on New Survey
  3. Select the Samples category
  4. Scroll until you see the Dates & Time survey sample or use the search function.
  5. Create a new survey from this sample

 

Create new survey sample in survey123 Connect

 

Next, spend some time going over the survey. I suggest you explore it first in Connect and you also bring it into your phone or a web browser to see what it feels like. The structure of the blog pretty much follows the sample survey.

 

Basic Types and Appearances

496812_DatesAndTime.png

 

The Basic Types and Appearances section of the survey sample explores the different ways in which a date or time question can be presented to the end user. Combinations of the question type and its corresponding appearances, will help you control the best user input style that fits the needs of your workflow.

 

The first question in this survey is of type date and it uses no appearance. A calendar control is shown for users to pick a date.  Note that the question shows the current date by default. This is accomplished by setting the default column in the XLSForm to today().

 

The following 3 questions illustrate the use of appearances: Year, Month-Year and Week-Number.

 

  • Week-Number is the most exotic. Week numbers are often used in government and business for fiscal years and timekeeping. With this appearance, the calendar widgets will let the user pick a date and display the week number in the form.  You will also see the week numbers on the side as you select the date. The week numbers are calculated following the ISO-8601 standard.
  • The Year and Year-Month appearances are handy when you simply want to present the user with a choice to pick a year, or a year-month.

 

As you exercise the calendar control, it may not be obvious, but you can actually tap and hold the arrows to quickly navigate back and forth in time.

 

Survey123

  • The DateTime and Time questions are shown at the end of this first section. Note that the questions automatically show the current date and time. This is accomplished by adding he now() function into the default column.

 

Understanding Dates and Time in ArcGIS

 

The Date, DateTime and Time types of questions as well as their corresponding XLSForm appearances, help you control the user experience that you want to present to the end-user capturing the data, but it is also important to understand how that date will be stored in ArcGIS.

 

User input to the Date and DateTime questions will be persisted in ArcGIS in a field of type Date (esriFieldTypeDate).  Despite the name of this field type, ArcGIS does not store just dates in Date fields: ArcGIS date values always include time as well. Hence, there is a perfect match between DateTime questions in Survey123 and ArcGIS date fields, but when it comes to date questions in Survey123, you need to understand that actually the time will also be stored.   But what time? Well, it depends:

 

  • The time will be noon (12:00PM) if the user has manually selected a date, or if you set the date using the today() function.
  • The time will vary if you set the date using the now() function. Now captures the current time, even if your date question does not show the time to the user in the form.

 

The screenshot below shows how you can configure a date field in your layer to display time. Note that in the Map Viewer, I had to open first the Fields dialog, then click on the date field and finally turn on the "Show time" option.   Once you do this, your popups will display time information!

 

IsmaelChivite_0-1695060726614.png

Time values in Date and DateTime questions  are always persisted as Coordinated Universal Time (UTC). This is important when you have people working in different time zones. ArcGIS clients will translate the stored UTC values into your local time zone. The only exception is ArcGIS Pro. ArcGIS Pro will show the time in UTC (unless configured to do otherwise).

 

So far, I described how date and datetime questions behave. Lets talk next about Time questions, because they are special. For Time questions, Survey123 does not use the ArcGIS date type (which we know now that actually stores date and time). Survey123 time questions store values as a string. We did it this way, because otherwise you would get dates as well, and this could be confusing: Say you want to capture the time when a store opens.... you would not want the date in there...  Now, because time is stored as a string, there is no information regarding the time zone in it. As such, you need to keep in mind that there will be no time zone conversion.  Later in the survey, we will explore how to capture times differently.

 

Date and DateTime questions store values as date objects including time. Time questions store values as text.

Formatting Dates

 

All graphical controls in the Survey123 apps will honor your locale regional settings. For example, if your browser or smartphone's locale is set to Spanish, then dates will be formatted the Spanish way (which is the correct one, by the way... just kidding).  In the next screenshot I show what the calendar control will look like in a phone set with United States vs Spain regional settings. Note that when using the Spain regional settings, the day goes first, then the month and then the year, versus the US version where the month goes first then the day and then the year.

 

Survey123 Dates English Spanish

 

Additionally the format-date and format-date-time function allow you to convert date objects into strings.

 

In the following example, we  use the wsdatetime question to capture the date and time at which a water sample was taken. The wstime question calculate will be hidden from the end-user and is used to extract the time entered and persist it as a string in military format.  Note that the output of the wsdatetimequestion is stored in ArcGIS as a date object in UTC, versus the wstime which will be stored as a string using local time in your device.

 

type name label calculation

dateTimewsdatetimeSample Date/Time 
calculatewstimeTimeformat-date(${wsdatetime},'%H:%M')

 

The qualifiers in the format-date function are as follows:

%Y4 digit year
%y2 digit year
%m0-padded  month
%nnumeric month
%bmonth name abbreviated
%d0-padded day of month
%eday of month
%H0-padded hour (24-hr time)
%hhour (24-hr time)
%M0-padded minute
%S0-padded second
%30-padded millisecond ticks (000-999)
%aThree letter short text day

 

Date and Date-Time Defaults

 

Survey123 accepts three possible values in the XLSForm default column:

 

  • today() This function returns the current date in your device. Typically you apply this function to questions of type date. The time part of this date will always by noon (12:00pm).
  • now()  This function returns the current time in your device. Typically you apply this function to questions of type datetime.
  • Finally, you can also apply a fixed date in ISO 8601 notation. For example: 2020-06-23T00:00:00-07:00.
    • 2020 for the year. Always 4 numbers.
    • 06 for the month. Always 2 numbers
    • 23 for the day. Always 2 numbers
    • T is simply a separator, for time. Always T.
    • 00 for the hour. Always 2 numbers
    • 00 for the minutes. Always 2 numbers
    • 00 for the seconds. Always 2 numbers
    • -07:00 is the UTC offset, which in this case is minus 7 hours.

 

Technically, you could also apply default value using Unix epoch notation (in milliseconds), but this would only work in the Survey123 field app. For consistency across the field and web apps, it is best to use ISO 8601 notation.

 

Constraints and Calculations

 

This section of the sample survey will be useful to understand how you use formulas with dates and date-times, so you can validate user input, as well as pre-compute date values. The questions in the survey are self-explanatory, The best is that you have a look at the XLSFile to better understand how things are done.

mobapp.png

 

  • Constraints: A common constraint you will want to enforce is one that ensures a date is in the past or the future. That is pretty straight-forward: .> now() will ensure the user input is in the future for example. If you want to reference another question in the survey, you can use something like this: ${birthdate}<today(). This will ensure that the birthday question has a value in the past.

 

In constraints you may be asked to ensure a value is always newer and older than a fixed date. The date function is very useful in these cases. For example, you can set a constraint such as . > date('2006-01-01') or ${manufacture_date} > date('2006-01-01').

 

If you need to work with time constraints, simply add the time component to the date() function using the ISO 8601 notation.

 

 

  • Calculations: Calculations are easy too, as long as you understand that dates in the Survey123 app are encoded as numbers. When users pick a date or a date-time in the survey, all values will be presented in a human friendly way, but internally the application handles them as numbers that represent the total time elapsed since 1970. A positive number represents a date after 1970 and a negative number a date in the past.  As you can imagine those are pretty big numbers, but the math is simple once you understand how time is expressed. There are basically two formats for the elapsed time:

 

  • Unix epoch is the elapsed time since 1970 expressed in milliseconds.
  • Decimal date or French Revolutionary Time is the elapsed time since  1970 expressed in decimal days. That is, one day is 1.0, an hour is 1/24, a minute is 1/24/60, etc.   To learn more  about Decimal Time have a look at this 'How the French made a 10-hour day' article. You will love it!

 

 UNIX EPOCHDECIMAL DATE
2 weeks into the futurenow() + 14*24*60*60*1000date(decimal-date-time(now()) +  14)
Calculate age from birthdayint((today() - ${birth_date}) div (1000*24*60*60* 365.25))

int((decimal-date-time(today()) - decimal-date-time(${birth_date})) div 365.25)

Minutes spent for lunchint(${LunchEnd} - ${LunchStart}) div (1000*60)

int((decimal-date-time(${lunchends}) - decimal-date-time(${lunchstarts})) * 24*60)

15 minutes from nownow() + 15*60*1000

date-time(decimal-date-time(now()) +  0.0104166675)

0.0104166675 is equal to  (1 (day) / 24 (hours) / 60 (minutes) ) times 15 (minutes).

I recommend you work with decimal date format, because then your XLSForm expressions will work both in the field and web apps. The Survey123 web app ONLY supports decimal time.

If you plan to use date expressions in the web app, use the decimal-date-time function.

If you ever need to populate a Survey123 date or dateTime question using a UNIX epoch number, you can use an expression like this:

 

typenamelabelcalculation
textepochEpoch (milliseconds) 
dateTimemydateThe Datedate-time(int(${epoch}) div 86400000)

 

Calculates and Relevants

 

This section in the sample survey is very similar to the previous one, but shows some other techniques that may be handy. For example, note how a calculate question is used to get the Lunch time computed, and then that value is used in other expressions throughout the survey.   A calculate is a type of question that will let you keep the result of a calculation without having to show it to the user in the survey. 

 

You will remember that questions of type time are ultimately stored as strings in ArcGIS, however, as far as calculations go, you will treat them as numbers. That is actually pretty handy because otherwise, you would not be able to do much with them!

 

Other ways to capture Time

 

The last section in the sample survey shows other techniques to capture time.

mobapp2.png

  • The 'Time from a list' example should not come as a surprise. A select_one type of question with minimal appearance is a nice way to present a list of hours to choose from.
  • Then there are some other examples illustrating how to use regular expressions in constraints as well as input masks.  I will go into the details here, so nothing is missed.
    • First, an example to capture military type with a period. For example: 11:35.  Note the use of an input mask here. The input mask automatically adds the period (:), so the user does not have to worry about that. The value of the input mask is 99:99 meaning that we expect to digits followed by a period and two more digits. You will see that the constraint column checks to make sure that the hours do not go beyond 23 and the minutes do not go beyond 59.  Note: input masks are NOT supported in the Survey123 web app.
    • In the second example, we want to capture military time, but without the period. For example: 1135. In this case, I want to highlight a couple of things. First, note that I am not using an input mask like before. It is not needed, because we can set the type of question as integer (to ensure that only numbers can be typed) and also set the the maximum length of the field to 4. This is done through the bind::esri:fieldLength column. This will do two things: will ensure that only integers with 4 digits can be entered into the Feature Service, and most importantly, will limit the user input in the Survey, to 4 numbers.  I still added a regular expression in the constraint to ensure that proper values within the 24 hour day are entered.
    • In the third example, I want to capture military time including the time zone. For example 1445Z. Z is the time zone (ZULU, which represents UTC). In 1445G, G is for Golf and represents UTC + 7.  That would be 1445 Golf Time. How awesome is that! More details on this crazy business with Time Zone Abbreviations here. Again in this case I added a mask and complemented it with a regular expression in the Constraint.

 

If you are not familiar with input masks in Survey123 I recommend you have a look at the Esri custom columns help topic. Regular expressions are tricky to put together, but you can find loads of samples in the web.

 

Start and End

 

So far, we have been looking at date and time questions that were visible in the survey. It is for this reason that we cared about the user experience (types of questions, defaults and appearances) as well as the validation of inputs (input masks, constraints).  Now, in Survey123 there are a couple of handy question types that will capture time without the end user knowing. These questions are start and end.  When added to your survey, like in the Sample you are looking at, they will not show in the survey to the end-user, but they will populate data in the Feature Service, that you can see from the survey123 web site or a web map.

 

Start and end will capture the exact date and time at which the survey was initially opened by the end user, and flagged as done. For you to see how this works, the best is that you load the survey in your phone, complete a couple of surveys and submit the data.

 

The start and end values are useful if you want to understand how much time people in the field take to complete surveys. To calculate the duration of the survey, you will need to download the data in FileGeodatabase or Shapefile format and calculate a new field with ArcGIS for Desktop. This ArcWatch article describes how you can calculate the duration between two date fields.

 

On top of start and end, which are optional, you will always get the Creation and Last Edit date and time for every row you add from Survey123 for ArcGIS. It is important to highlight here that the Creation and Last Edit columns are handled through ArcGIS Editor Tracking. The help has a good topic on Editor Tracking in case you are not familiar with it. Do not worry about  enabling Editor Tracking in Survey123, because it is always enabled by default. This feature looks at the time when edits are made in the Feature Service not when the data is necessarily being captured or changed in the field. For example, if someone is working in the field while disconnected from the network, the start and end field will truly reflect the time when the user is working on the survey. The Creation and Edit Times will reflect the time when the data was actually submitted: May be immediately after data capture, or may be a couple days later while back in the office.

 

This was a long post, but I hope you find it useful.

107 Comments
NaomiBegg2
Occasional Contributor III

If dates are store as a string does that mean that logic such as < now() cannot be used?

I am trying to create a survey that requires the user to potentially add 6 times in, all of which refer to the same date.

Is there a way to hide the date part of the question and just leave the time to be entered (default date to now() unless the time entered is greater than now() then the date would be now()-1) ?

I find the scroll on the date quite clunky, especially when you are adding multiple times into one survey.  Is there a way that this can be changed from a scrolling time to a simple number pad entry? 

MitchellProctor
Occasional Contributor II

Hi Naomi,

You shouldn't have to worry about that first point, logic like now() is still fully functional. This update to date and time fields just provides an alternative way to handle time.

As to your complaints about the scroll interface, unfortunately there's no way to do this just yet.

NaomiBegg2
Occasional Contributor III

Thanks Mitchell,

I've found that the now() does still work, however what about creating a function such as now()-1.  The point of this being that only the last time field should be 'now' and everything else should be prior to this and to remove any opportunities for potentially lazy users to enter incorrect data.  So I would like to make the default now() [even though this would be defying my logic that it can't be now] and the logic now()-1. 

MitchellProctor
Occasional Contributor II

How you would actually do this depends on if you're using Epoch time or decimal time. If in this case you want the day before the survey was taken, this sample would work for Epoch time:

now() - 1000 * 60 * 60 * 24

What you're doing there is basically adding exactly the amount of milliseconds in a single day, so it comes to the time exactly one day before the survey was taken.

Decimal time is a little easier to read in this case, because it works on days. This means that your now() - 1 example is right, although it does look a little different since it needs to be converted back and forth.

date(decimal-date-time(now()) - 1)

JohnathanHasthorpe
Esri Regular Contributor

Just to address the question about an alternative to the date scroller. You can use text fields to capture the time component if you prefer. I have attached a sample that enables the entry of 3 times as text and then adds each of them to the current date. I think this should help you achieve what you are wanting to do:

GeonetTimes.xlsx 

MarioFederis1
New Contributor III

John, can you re-upload the excel? I'd like to take a look at how you can enter a time field as text.

I agree with Naomi's complaint. Regarding Survey123 for ArcGIS desktop app, It doesn't make sense to have time selection via scrolling when someone's behind a computer with no touch screen functionality.   This should definitely be addressed.  I have dozens of users needing such feature.

Ozman
by
New Contributor II

Hi, Ismael Chivite,

I have a question: Why in my datetime field always have another different UTC zone when I export to csv or excel? for example +6 UTC, how can I do for fix it.

Thanks for read me

JamesTedrick
Esri Esteemed Contributor

Hi Osman,

When downloading the data in CSV or XLS, you will receive dates in UTC time.  We will be bringing in support to record the offset from UTC (and use that in calculations to get 'local' time) as an optional metadata field in the next release of Survey123.

Ozman
by
New Contributor II

Thanks, James.... it would be great and very useful to take it into account in the next release.

ThomasPerriment1
New Contributor III

I've noticed that within repeats, when a dateTime field is relevant to another question, using now() as default will give the time at the creation of the repeat, not that actual current time. When using now() in the calculate column, whilst it does give you the correct time, when cycling through repeats (moving from 2 of 2, back to 1 of 2, for example) the dateTime will be recalculated and you will lose your original entry. Struggling to work past this one!

JohnathanHasthorpe
Esri Regular Contributor

Hi Thomas

Have you tried to use the once() function? i.e.:

once(now())

This will mean that the now() function will only run once when you add the repeat.

Cheers

John

MarcoCastoldi
New Contributor

How can I set the date in my survey to appear as dd/mm/yyyy? In the type column of the survey I wrote only "date" but the hour still appears in the exported data.

IsmaelChivite
Esri Notable Contributor

You can add a hidden question and use the format-date() function in its calculation column to get the dd//mm//yyyy string out of the DateTime object.

Both date and datetime XLSForm questions map to date geodatabase field types, which despite its name are actually datetime field types. That is why you see your date question stored as datetime.

erica_poisson
Occasional Contributor III

If I have a dateTime question in my survey that defaults to now(), should the following calculation ensure that when the data is exported to Excel, or viewed in Pro that the time within my dateTime field will be in my proper time zone, instead of UTC?

Calculation:

pulldata("@property", "utcoffset")

Thank you!

JamesTedrick
Esri Esteemed Contributor

Hi Erica,

That will provide you the information needed to calculate the correct time in non-UTC aware applications. To calculate a 'timezoned' datetime, you would want

now() + pulldata("@property", "utcoffset")*1000*60*60
erica_poisson
Occasional Contributor III

Hi James,

Thank you for getting back to me. I haven't been able to get the calculation above to work. I've been fiddling around with it, and none of my test iterations have worked properly - everything is still showing up as the UTC time.

Just to confirm, within my dateTime row in my XLS, my default = now(), and my calculation = now()+pulldata("@property, "utcoffset")*1000*60*60

I've tested this by actually switching out "@property" and "utcoffset" with values of dateTime and -04:00 respectively.I've received no errors when saving the XLS, or validating the input, however when I enter a test survey and view it in Pro, the time is still in UTC.

I'm sure it's something very basic I am missing.

JamesTedrick
Esri Esteemed Contributor

Hi Erica,

In this situation, you would not want the default value - only the calculation.

ThomasPerriment1
New Contributor III

Hi James,

Great to see this feature included! When using the following calculation whilst in the UK:

format-date(now() + pulldata("@property", "utcoffset")*1000*60*60,'%d/%m/%Y %H:%M')

I seem to get a date an hour into the future, almost as if it has applied the offset twice. I'm using an iPhone 8 with time zone set to automatic (London). Do you have any suggestions as to why?

Does this offset account for daylight savings time?

by Anonymous User
Not applicable

Hello,

I am trying to display a reformatted date and feel like I'm missing something obvious...

My dateTime fields always display as %A, %d %B %Y %H:%M (eg. Monday, 08 October 2018 11:30) but there isn't enough room on a phone to display all of that information without losing some beneath the dropdown for selecting a date.  

I've tried a variety of different format-date() calculations but nothing changes how a date is displayed for me. Has anybody had luck with this?
My attempt is below;

typenamelabeldefaultreadonlycalculation
dateTimedtDateTimenow()
calculatedtSmallReformat datetimeformat-date(${dt}, '%Y/%m/%d %H:%M:%S')
dateTimedtNZSTNZSTyes${dt}-if(pulldata("@property", "utcoffset")=13, 60*60*1000, 0)

Also might be of interest - the third line checks if we are currently in daylight time (UTC+13) and reformats into NZ standard time (-1 hour).

PhillipBailey
New Contributor

If this survey (Dates&Time) is published to the web version, much of the functionality and calculations do not work. I tried in Chrome (Version 71.0.3578.98). Is this intended? Are there different calculations and considerations that must be made when intending to publish to a web form?

This message appears upon opening as well.

JamesTedrick
Esri Esteemed Contributor

Hi Phillip,

The '@property' use of the pulldata function will be supported in an upcoming version of Survey123.

PhillipBailey
New Contributor

Does that also explain why the other calculations were functioning? The @property error was a side note. I was more concerned with the functionality of the calculations that worked before the new v3 release.

JamesTedrick
Esri Esteemed Contributor

Hi Phillip,

Yes, the error you see indicates that the form is failing to load.

MonicaZhang
New Contributor II

I have a survey with two time fields. When entering any time between 12:00 PM and 12:59 PM, the form doesn't seem to recognize the time and I get a "This is a required question" prompt and cannot submit an entry. I've cycled through all other hours and this only seems to happen with the hour of 12 PM. I also don't get this message when I validate the input in Connect. There's no constraints, calculations, or any other special settings for these questions besides making them required (the default was Now, but I removed that and am still getting this error). The survey version is 3.1. How do I fix this?

BrandonArmstrong
Esri Regular Contributor

Hi Monica,

This appears to be caused by a defect with how the webform is reading the entered time value.  At the moment, time values that fall between 12pm and 1pm are encountering a switch from PM to AM. As a workaround, you can remove the requirement of the question, however, keep in mind that the values between 12PM and 1PM will be input as AM.  I have gone ahead and raised the issue internally and we will be looking to address this as soon as possible.

Best,

Brandon

MonicaZhang
New Contributor II

Thank you Brandon for the quick response. I'm not sure if it'll work for the users for 12 PM values to be written as 12 AM instead, so hopefully this can be fixed soon!

RyanDeBruyn1
New Contributor III

As of this time 2/4/2019  this issue still appears in my webform entries.   Any thoughts to when this issue be addressed? 

I entered 1/31/2019 12:01pm in my form and the data appears as 2/1/2019 12:00AM

Regards.

-Ryan

BrandonArmstrong
Esri Regular Contributor

Hi Ryan,

There is no hard timeline of when this issue will get addressed, but it will likely be with the 3.4 release of Survey123

KarolFallas
New Contributor III
Hi,
There is a way to quickly navigate the calendar to choose an old date?.
IsmaelChivite
Esri Notable Contributor

Hi Karol Fallas‌.  Time flies when you tap and hold the left (back) and right (forward) arrows in the calendar control.

KarolFallas
New Contributor III

Hi Ismael,

Thank you!

MonicaZhang
New Contributor II

Hi again, how would you calculate the difference between two time fields (not dateTime)?  I'm running into issues since Connect returns the time in epoch format, but the web form returns a string. I have two time fields, called startTime and endTime. If I have a hidden field where the calculation is only ${startTime}, the calculated field is something like "155704000000" when I validate it in Connect but "13:00:00.000-07:00" in the web form.

So using decimal-date-time(${startTime}) works perfectly in Connect, but doesn't work in the webform--I get "NaN" since startTime is now a string. I had the idea I could concatenate the time string with a date date string and convert it to a date-time I can use in calculations, but formulas that might work for the web form using time as a string don't work in Connect since times are in epoch format, so I can't publish a survey using these calculation. Using date(concat(format-date(today(),'%Y-%m-%d'),'T', ${startTime})) results in an error when I try saving the XLSForm.

The only option seems to be changing the time to decimal time, which does work but it's imprecise. For example, I get 0.24000000000002 hours as the difference between 1 and 1:15. Are there any other methods I could use? Or should we just steer clear of using Time questions if we're going to do calculations? Thanks!

JamesTedrick
Esri Esteemed Contributor

Hi Monica,

decimal-time() is the correct function to use.  It appears you are getting a floating-point calculation issue (I got 0.25000000018 for the values you specified); I would recommend rounding to an appropriate level of precision (1 minute is 0.000694444... in decimal time, so 4 digits should be good enough for a minute).

MonicaZhang
New Contributor II

Hi James, thank you for your response. Was the number you got from doing the calculation in Connect? I get 0.2500000000018 as the difference between 1 and 1:15 in Connect, but 0.24000000000002 in the web form. For 3:45 to 4:00, it's 0.24999999999999991 in Connect but 0.26400000000000023, so rounding will still give me numbers that are slightly off. I know it's only a 0.01 difference at most, but it's enough to bother people who are trying to calculate hours spent on a project. We decided to just not do a calculation and have users report their hours themselves, but it would be nice if there were a better way to do time calculations in Survey123.

JamesTedrick
Esri Esteemed Contributor

Hi Monica,

What you're encountering is a basic issue in floating point calculations; the most reliable way to solve is to round to the level of precision you actually need.

JodyZhengLiu
Esri Contributor

Hi Monica,

This has been fixed and will be available on our next release (version 3.4) late May. Would you please have a try then?

 

Thanks and best regards,

Jody Zheng Liu

MonicaZhang
New Contributor II

Hi Jody, I just tried it after changing the survey settings and am no longer getting that error. Thank you for letting me know!

Jim-Moore
Esri Regular Contributor

Hi Monica Zhang, following from our conversation last week at the UC, just an update that we've logged this one to take a closer look at. As we saw in our quick testing, it appears the decimal questions with a decimal-time() calculation are being rounded to three decimal places in the web app, causing issues with subsequent calculations. I'll endeavour to keep this thread updated with any progress. Hope you had a great UC!

Best regards,

Jim

BetsyDuarte
New Contributor

Hello,

I was wondering if there was any update on being able to hide the date part of the question and just leave the time to be entered in a dateTime field. I can't use Time because I need to be able to calculate the total time and have it work on the web.

Thanks, 

Betsy

by Anonymous User
Not applicable

Hi Betsy,

No, this is not possible.

Phil.

DanteLee
Occasional Contributor II

Is it possible to pull the date range for a week-number? e.g. Week 33 = Monday, 8/12 - Sunday, 8/18

DanteLee
Occasional Contributor II

Hm scratch that. Week-number doesn't seem to be supported on web, so I'm using a workaround to constrain the date selection to a Monday instead.

S_-_EvanRaskin__GISS_
Occasional Contributor

Is there a way to include the publish date-time as a field in a survey? This would be helpful for us so that we know what version of a survey was used when certain data were collected, as well as checking that we are using the latest version on our field devices. Currently I am manually updating this each time I make edits to my XLSForm, but would be much more convenient/foolproof if it could update automatically.

DanteLee
Occasional Contributor II

Yeah, you could use the Start/End field types. See this comment for more details

S_-_EvanRaskin__GISS_
Occasional Contributor

Dante Lee‌, how would I set that up such that it stores the date-time that the XLSForm is last saved (or published), as opposed to when I launch a survey in the app?

DanteLee
Occasional Contributor II

Ohh I misinterpreted what you were looking for. I suppose you could set the default value of that field using the TODAY or NOW function in Excel. The date/time updates when you open your spreadsheet form. Haven't tested if it returns an issue in S123

=TODAY()

=NOW()

S_-_EvanRaskin__GISS_
Occasional Contributor

Hmm, that might work. Last time I tried mixing Excel formulas with Survey123 it broke, but this one doesn't appear to have that problem. I would prefer that it record the time last saved rather than the time last opened, but there's no way to insert a timestamp for the last time saved in Excel without using a macro or an add-on, which I'm hesitant to try to mix with S123.

S_-_EvanRaskin__GISS_
Occasional Contributor

Actually, looks like it DOES update the =NOW() field when I save/push to S123 Connect, which is perfect. I think this will work. Thanks for the suggestion, Dante Lee‌.

S_-_EvanRaskin__GISS_
Occasional Contributor

Another option is to put =NOW() in the version field on the settings worksheet, then use version() in a calculate.

DenaS1
by
New Contributor II

I have a date field for year, and I would like the default to be blank. It seems the default instead is the current year. How do I change this?