Prevent duplicates based on key data in csv with choice filter

1. What is the problem? Be very detailed.
I store submitted data as a concatenated key in submission. The submission updates existing external CSV daily. I pulldata against the key and constraint prevents progress in form if there is a match found. It works fine without using a local choice_filter elsewhere in the form. But as soon as I introduce local choice_filter anywhere in the form, I get the following error when validating/generating xml:
ERROR
"The same instance id will be generated for different external instance source URIs. Please check the form.Instance name:'supplier', Existing type: 'pulldata' Existing URI: 'jr://file-csv/supplier.csv', Duplicate type: 'choice', Duplicate URI: 'None', Duplicate context: 'survey'"

2. What app or server are you using and on what device and operating system? Include version numbers.
Aggregate to serve the forms and media/csvs. Google sheet for submission.

3. What you have you tried to fix the problem?
The choice filter works and validation is successful when i remove the pull data.
The pulldata works and validation is successful when i remove the choice filter.

If I arbitrarily change the name of the csv ('supplier') in pulldata to a random csv name ('supplierrrrrrr'), then form validates with the choice filter present successfully. This trick validates the form but it wont work in collect as the csvname is mocked.
So pull data works normally and so does choice filter. there appears to be no relation between the two. yet the error shows up.

4. What steps can we take to reproduce the problem?

file attached.
**products_test2.xlsx (220.9 KB)
**
choice filter in cell: 78F
pull data in cell: D122

Error occurs both when validating form or generating xml online and offline.

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
attached above

1 Like

What exact version of ODK Collect are you using?

I am using ODK Collect Version v1.21.1

Hi,
Was this solved? I'm encountering the same issue. Would appreciate any pointers

During converting the form form xls to xml?

This occurs during deploying of the form So I think yes

it doesn't sound like you are sure... is it a message returned using this tool? http://opendatakit.org/xlsform/

Sorry, perhaps I have not explained myself well enough.
I'm trying to generate a form with select questions that will get choices from an external document. To do this, I'm using the type "select_one_from_file". This works well for questions that will display all the choices. However, I need to limit the choices shown in the select based on an answer to a previous question. To do this, I added a column "choice_filter". At this point, when I upload my XLSform and try to deploy, I get the error message

"your form cannot be deployed because it contains errors:

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

How can I be able to both get my choices from a separate file and filter the choices as the choices are many and putting them in the choices sheet slows it down to a point I can't use it

Could you attach your form?

where is the product csv file could please upload it to us
kind Regards

@safi, did you resolve your problem? I seem to have hit the same issue, but my form is quite complex. I will try to create a minimal example if I find a moment.

My problem was very similar and might be relevant to this issue: Cannot use pull_data, search() and choice filter in the same form - #5 by mixmixmix
There are two reasons for those problems, one is using non-standard naming in the csv file, another a bug in pyxforms (if that's what you use)

1 Like