Choice Filter within a repeated group in KOBO Toolbox

Dear All,

I am having an error in deploying xlsx form in KOBO Toolbox. The error occurred in choice_filter within a repeated group. The data collection form is designed to collect general training info and detail participant info like training place (township, village tract, village - which are connected with choice-filter, total number of participants - which is linked to the number of repeats for individual detail info in which township, village tract and village names are also asked).

It would be very grateful if anyone could help me in this error.

Best,
Han Lin

Hi @hanlinaung

welcome to the forum! When you have the chance, please introduce yourself here!

It is possible that your error is due to referencing a variable defined in a repeated group, which for groups of 2 or more items would not be unique.

In order to provide better assistance, please follow the questionnaire below, possibly attaching the form or screenshot.:

1. What is the problem? Be very detailed.

2. What app or server are you using and on what device and operating system? Include version numbers.

3. What you have you tried to fix the problem?

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

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

Hi @Andrea_Martin

Many thanks. I am quite new for KOBO Toolbox.

  1. My problem is that when deploying the form in kobotoolbox website, I got an error like ODK Validate Errors: >> Something broke the parser. See above for a hint. org.javarosa.xpath.XPathException: XPath evaluation: Parse error in XPath path: [instance('village_tract')/root/item[township1=position(current()/../ ${township} )]]. Unexpected beginning of path Result: Invalid

  2. KOBO Collect android application - version 1.23.3k and kobotoolbox website server

  3. I tried to fix the problem of choice_filter within a repeated group. The data collection form is designed to collect general training info and detail participant info like training place (township, village tract, village - which are connected with choice-filter, total number of participants - which is linked to the number of repeats for individual detail info in which township, village tract and village names are also asked).

  4. can you all please provide any suggestion on how to fix the problem as I am beginner for KOBO Toolbox?

  5. testingforsmp

Although Kobo does repackage ODK tools, we don't always know what versions they use. Please ask your question on the Kobo forum.

Thank you @LN.. I will ask in the KOBO forum

Hi @hanlinaung,

I noted that you had some typos in the choice filters.
Currently you have:
township1=position(current()/../${township})
village_tract1=current()/${village_tract}
the left side of the equality should be the name of the filter (township, village_tract), and the variable called have the "1".

I modified them as follows:
township=${township1}
village_tract=${village_tract1}

I've tested the revised version testingforsmp.xlsx (16.9 KB) on Enketo and it worked fine.

I'm not sure whether this would work on Kobo, but I hope it helps.

Side comment:
You might want to set vars ${male} and ${female} as required. Otherwise, if one of the two fields is skipped, the ${total} might not work (i.e. "NaN").

Best,
Andrea