Java.lang.string cannot be cast to java.lang.integer

Dear Kobo Toolbox Support Team,

I’m contacting you with a question on my survey project.
When filling the survey in the kobo collect app, I get the following error message:

“java.lang.string cannot be cast to java.lang.integer”

Since I am a new member, I cannot upload any pictures/.xls forms-- apologies for that!

Any help with this would be much appreciated. If you require additional information, let me know.

Many thanks in advance and all the best,
Nina

Hi @ninsb, welcome to the community!

Can you validate your form in here ODK - XLSForm Online to see if there are any syntax issues with your form?

There are some posts related with your issue:

1 Like

Hi @hakan_cetinkaya,

Thanks a lot for the lightning-fast response! I get no syntax errors in the validation tool. Also, the survey works fine in the preview mode. However, I’m still unable to fix the error message in the Kobocollect app.

Any pointers would be much appreciated!

@ninsb, If you remove the translations, do you still see the error message?

1 Like

yes, unfortunately.

1 Like

@ninsb, If you remove the relevant: ${First_time_user} = 'option_1', do you still see the error message?

1 Like

@hakan_cetinkaya , yeeees :face_with_peeking_eye:

1 Like

@ninsb, I see some incomplete translations in the survey sheet:

And also some incomplete translations in the choices sheet:

The second part I observed when scanning your XLSForm is that it uses - as shown in the image shared below:

Image 3

Could you also replace the - with _ (underscore) please?

Would you first fix these and test them again to see if these fix should solve your issue? Feel free to share your XLSForm if the issue is still on. Maybe the community should then also be able to debug your issue further.

1 Like

Thanks @Kal_Lam, I resolved the issue by changing the question type from “select one” to number. Everything works fine, including the translations.

2 Likes

Thank you for sharing this solution with the entire community @ninsb! :clap: :heart: :partying_face: