HOW TO
When creating a survey with a date question in ArcGIS Survey123 Connect, dates such as public holidays and weekends can be excluded as these dates may be unrelated to the survey. Users may want to include only work days in the survey.
To exclude public holidays or weekends from a date question in ArcGIS Survey123 Connect, apply a constraint. However, before applying the constraint, the dates must be converted to a readable format using the format-date() function in decimal time. This is because ArcGIS Survey123 Connect processes the date and time values as Epoch time (also known as Unix time) by default. Epoch time stores time as the amount of milliseconds elapsed since January 1, 1970, which is an approximate value. This time is also constantly changing every millisecond, rounding off to the nearest value.
To change the Epoch time of the date question to a decimal time, create a secondary question that references the date question. Use the format-date(${date},'%m/%d/%Y') expression to convert the date to a date format. Apply the constraint to the secondary question using the format-date() function in the constraint column.
Follow the instructions described below to achieve the desired result:
Note: There are various format-date expressions that can be used for date questions. For example: format-date(${date_question},'%m/%d/%Y') = 25/12/2019 format-date(${date_question},'%m') = 12 format-date(${date_question},'%b %d, %Y') = Dec 25, 2019 Select the desired expression.
The images below show the complete survey table in the .xls worksheet for the calculation column (top image) and constraint column (bottom image).
Get help from ArcGIS experts
Download the Esri Support App