Hi! I'm using Survey123 Connect version 3.21 and have two time only fields that I am trying to convert the output into a readable text field for the end user. The formulas I am using in my calculation fields work in the Survey123 Connect preview, but once the survey is published, and I input my time values, I get an Invalid Date error. My formulas are based off of what was in this article from ESRI Support: How To Display time in readable format when concatenated with text values in ArcGIS Survey123 Connect
This is the calculation used for the beginhour_text field:
concat((if(format-date(${time1begin},'%h')>12,(format-date(${time1begin},'%h')-12),(format-date(${time1begin},'%h')))),':',(string(format-date(${time1begin}, "%M"))),(if(format-date(${time1begin},'%h')<12," AM"," PM"))) |
This is the calculation used for the endhour_text field:
| concat((if(format-date(${time1end},'%h')>12,(format-date(${time1end},'%h')-12),(format-date(${time1end},'%h')))),':',(string(format-date(${time1end}, "%M"))),(if(format-date(${time1end},'%h')<12," AM"," PM"))) |
This is the calculation used to bring both begin and end time together as timevalue1 for use in the Restrictions applied section of the Director's Order:
| if(${time1}='All Times', 'All Times', concat(${beginhour_text}, ' - ',${endhour_text})) |
Time Fields in Survey123 Connect Preview
Time Output in Survey123 Connect Preview Director's Order Section
Invalid Date Error Showing in Published Survey for Same Times Shown in Survey123 Connect Preview
Time Fields in Survey123 Connect Excel Document
I am not sure what the issue is to cause the error, but any help is greatly appreciated! Thanks!
Bec