Survey123 time calculation type mismatch

840
2
Jump to solution
11-30-2021 12:23 PM
erica_poisson
Occasional Contributor III

Hi - 

I am having a type mismatch issue with some time calculations. I have an existing survey XLSForm which is formatted like this...the calculation works perfectly. The number of minutes elapsed is returned. In this instance, the user is prompted to enter two times in this format - XX:XX and then the third line determines minutes elapsed. 

erica_tefft_0-1638303251938.png

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 (we want the time to be entered like XXXX).

I've modified the XLSForm to do 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 the first 2 lines from the screen capture above (e.g. 10:45 vs. 1045, which is then calculated to 10:45). 

erica_tefft_1-1638303251939.png

Things I have tried - 

  • changing 'type' column to calculate for all intermediate calculations (lines 41 to 43 & 45 to 47)
  • changing bind::type column to 'time' for lines 43 and 47 (second screen capture)
  • changing bind::esri:fieldType to 'null' for all intermediate calculations
  • changing bind::esri:fieldType for line 48 from integer to string to no bind::esri:fieldType
  • changing bind::esri:fieldType to 'date' for lines 43 and 47

Does anyone have any suggestions? I also did test using the solution from this post, but it did not work. 

Thank you,

Erica
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

What about using the Input mask column with 99:99?    May be easier and look nice.

DougBrowning_0-1638304327223.png

 

View solution in original post

2 Replies
DougBrowning
MVP Esteemed Contributor

What about using the Input mask column with 99:99?    May be easier and look nice.

DougBrowning_0-1638304327223.png

 

erica_poisson
Occasional Contributor III

Wow - talk about overthinking something. Thank you! I haven't explored input masks yet - this is super handy. 

Erica