Pull datatime from csv works on Enketo but not on ODK Collect

1. What is the issue? Please be detailed.
Pull datatime field from csv works on Enketo but not on ODK Collect, the idea is generate a datetime field (named study_date) in an initial form submit, download the data in csv and then use this information in other form to find the difference in minutes between the current date and the study date. Attached formats work fine in Enketo, but not in ODK Collect.

ODK Collect: v2022.1.2, ODK Central v1.4.2

2. What steps can we take to reproduce this issue?
2.1. Upload the form dateTime_initial_data.xls to ODK Central, submit any data.
2.2. Download the data in csv as data.csv no group names (example in data.csv).
2.3. Upload the form dateTime_receiver_test_functional_Enketo.xls to ODK Central and in media files upload data.csv.
2.4. Try submit data in form dateTime_receiver_test_functional_Enketo, calling ID numbers 80131 and 1022 (previous in data.csv), in Enketo and then in ODK Collect . In Enketo it works well, in ODK Collect appears the error that I attach in the image error_in_format_datetime_ODKCollect.jpg next to ID insertion (ID related with csv data).

3. What have you tried to fix the issue?
I have tried to format the datetime as shown in the file dateTime_receiver_try_ODKCollect_test1.1.xls that once I tried to upload it shows me the error that I attach in the image error_try_fix.

4. Upload any test forms, screenshots, or logs below.
dateTime_initial_data.xlsx (12.6 KB)
dateTime_receiver_test_functional_Enketo.xlsx (13.2 KB)
data.csv (527 Bytes)


dateTime_receiver_try_ODKCollect_test1.1.xlsx (13.4 KB)

I appreciate your help so that it can work in ODK Collect as it works in Enketo

Usually it's best to convert dates and other data types to a number before doing calculations.

Try using a calculate like this for each date question: number(${date_question_name})

Hopefully that will allow the calculation to work regardless of whether the form is completed online or on a mobile device.

ODK Collect fails to convert the data extracted from csv to dateTime format because initially there is no data that satisfies the format to be converted. My solution was to put a conditional in a calculate field that indicates that if ID is empty put a date that satisfies the format to be converted, otherwise extract the data from the csv file. Additionally to make the difference between dates use int((decimal-date-time(${study_date_format})-decimal-date-time(${current_date}))* 24*60). This solution, which I present in the attached file, makes ODK Collect and Enketo work in the same way. I hope this solution can help you sometime.

dateTime_receiver_test_functional_Enketo_and_ODKCollect.xlsx (13.5 KB)