Conversion of text to date when using pull data

I want to pull data stored in a CSV of type date and perform a calculation with the data. works perfectly in my preview but throws an error when deploying.
your form cannot be deployed because it contains errors:

Unexpected KoBoCAT error 400: b’{“detail”:“ODK Validate Errors:\n>> Something broke the parser. See above for a hint.\nError evaluating field ‘try’ (${try}[1]): The problem was located in Calculate expression for ${try}\nXPath evaluation: type mismatch \nThe value \“Date\” can’t be converted to a date.\nCaused by: org.javarosa.xpath.XPathTypeMismatchException: The problem was located in Calculate expression for ${try}\nXPath evaluation: type mismatch \nThe value \“Date\” can’t be converted to a date.\n\t… 10 more\n\nThe following files failed validation:\n${tmpq7kvnc7j}\n\nResult: Invalid”}’

Welcome to the community, @edwinaikins! Maybe you will need to validate your xlsform through this online validator to fix the syntax errors present within your xlsform.

Hi @edwinaikins
Do you mind sharing the exact formula/calculation you had, or better still the copy of the XLS form with the calculation?
Stephane

sure. I just want to pull dates from my CSV and make a calculation with today() function

Hawker.csv (706 Bytes)

Hawkers-Verify.xlsx (12.1 KB)

@stephanealoo any help

Hi @edwinaikins ,

I came across similar issue, did you manage to get it solved?

Thanks,

Diego

I got a way to fix it. The date separator should be “-” instead of “/”.

Hope it helps :slight_smile:

Diego

1 Like

@diego_shirima, :clap: :heart:

would try it out. Thanks

1 Like

Thank you very much for sharing your knowledge. I have an urgent problem to solve, I made the exercise with the same form and cvs file but when I implement it in KoboCollect it does not perform the sum with the date extracted through the pulldata. I have tried in many ways but I have not succeeded.

I clarify that in Enketo environment it works perfect.