The xlsform attached returns the following error in Connect (3.12 and 3.13):
The issue is with this calculation:
decimal-date-time(${test_string})
When replace with the calculation below, the xlsform is processed and works properly:
if(string-length(${test_dob}) > 0 ,decimal-date-time(${test_string}),0)
Cheers,
Olivier
Solved! Go to Solution.
Hi @OlivierDemars1 ,
The decimal-date-time() function is used for translating across decimal day (i.e. 1= 1 day) and date (epoch ms 1 = 1ms) formats. Given your form, it appears you want the date() function (to parse a text string into a usable date) within a decimal-date-time function; that being said, there is a similar type mismatch error raised. That can be addressed with an intermediate function; see that attached example
Hi @OlivierDemars1 ,
The decimal-date-time() function is used for translating across decimal day (i.e. 1= 1 day) and date (epoch ms 1 = 1ms) formats. Given your form, it appears you want the date() function (to parse a text string into a usable date) within a decimal-date-time function; that being said, there is a similar type mismatch error raised. That can be addressed with an intermediate function; see that attached example
Hi @JamesTedrick -
I am having a similar issue...although with time instead of date. I have an existing survey XLSForm which is formatted like this...the calculation works perfectly. The number of minutes elapsed is returned.
I want to modify the survey to do some behind the scenes calculations so that field staff do not need to enter the colon (:) between hours and minutes. I've modified the XLSForm to this, and now my line 48, "Time_Elapsed" is throwing a type mismatch error. I can not figure out what I've done wrong as I feel like the results of line 43 (Interview_TimeColon) and line 47 (StartFishing_TimeColon) are not all that different from what was being input in lines 40 and 44 (e.g. 10:45 vs. 1045, which is then calculated to 10:45).
Do you have any suggestions? I did test what you show in the example XLS above, however it did not work - I continue to get a mismatch error.
Thank you,
I resolved this using the original set of questions (first screen capture above) in conjunction with an input mask specified for lines 40 & 44.
Within the bind::esri:inputMask column, I specified 99:99.
This allows users to just enter numbers, the colon is automatically added and the 'Time Elapsed' calculation works perfectly.
Thanks @JamesTedrick
Hello, @JamesTedrick
I have some issues with the calculation of dates in my Survey123 connect.
I'm trying to calculate the time (in days) between to dates field, but, I have the following error:
The problem is caused for one field, type "Date", Survey123 cannot convert this specific field in "decimal-date-time". If I set the calculation with another date field, or calculate the field with, UNIX epoch, works fine! I really don't know what's the problem.
Can I share the XLSForm to review this issue?