I cannot validate forms that uses csv in https://getodk.org/xlsform/ anymore

1. What is the issue? Please be detailed.

I was able to convert forms using https://getodk.org/xlsform/ until last week. Today I made an update to a form, tried to convert it and receive the error

Error: The same instance id will be generated for different external instance source URIs. Please check the form. Instance name: 'viviendas', Existing type: 'file', Existing URI: 'jr://file-csv/viviendas.csv', Duplicate type: 'choice', Duplicate URI: 'None', Duplicate context: 'survey'.

This happens with my old forms too, which previously worked as well.

The change was not related with the 'viviendas' csv file. All my old forms cannot validated anymore either. I noticed that there as been some updated to pyxform.

2. What steps can we take to reproduce this issue?

Upload the attached file on https://getodk.org/xlsform/
ENDS XLSForms -support .xlsx (482.5 KB)

3. What have you tried to fix the issue?

Looked into the forums for the error, it has been reported before, but I was using some of the work arounds. Also in the issue trackers, but I'm lost in which is the best form to present it to the XLSform converter.

4. Upload any forms or screenshots you can share publicly below.

Thanks in advance.

This is indeed related to a recent pyxform change. Previously, lists from the choices sheet that were not explicitly referenced from a select were ignored. Now, they are included in the converted form so that they can be referenced using instance().

It looks like you may have gone from using the search() appearance for populating selects from viviendas.csv to using select_one_from_file. There's a viviendas list on the choices tab that looks like it was for search(). Previously, you could have left it in there and pyxform would have ignored it but now it's trying to include it in the form and that's causing an error. Could you please see whether removing it makes the form work as you expect?

I think in this case it's reasonable to have to remove the extra list. Hopefully this case isn't too common. We'll also double check that there aren't deeper issues with search() and this new implementation. Although we generally recommend using select_one_from_file, we don't intend to remove search() support yet. Thanks for sharing this!

1 Like

I love the community! Fantastic catch it was buried in the line 2920 on the choices. Thank you very much. It solved it.

2 Likes