What is the problem? Please be detailed.
suppose a user selects a division from a list of choices, now there are multiple districts under a single division which are being mapped using choice_filter .
Now we want some fixed question for each district falling under the selected division dynamically ?
now if user selects Agra(IND00901) then we want to ask fixed questions such as no of workers etc. for each of dist under that division (ie AGRA,Ferozabad ,Manipur )
How can we make this happen.Thanks in advance!
What ODK tool and version are you using? And on what device and operating system version?
What steps can we take to reproduce the problem?
What you have you tried to fix the problem?
Anything else we should know or have? If you have a test form or screenshots or logs, attach here.
Hi @Souirji_Abdelghani i think i have not clearly explained the problem,
I am using choice filter to show the disctrict according to the division,
What i want is to ask 3 same questions for each district dynamically one by one.Thanks
This is possible but requires a little knowledge of XML and XPath as far as I know!
Here is a sample form showing one approach. Note that I had to look at the XML to figure out how to get the district count and the district name. I added a notes column to try to explain the details. You should be able to start from this and add any questions you need in the district_questions repeat. Note also that repeat-over-filtered-choices is the filename I used which then becomes the document root. If you change the XLSX filename, you'll need to replace the name in the calculations as well.
If anyone knows of a more straightforward way to achieve the same thing I'd be very interested in seeing it! This is a really useful pattern so perhaps we could think of way for XLSForm to make this friendlier if it doesn't already exist.
Hi,Thanks for the reply.
I tried your form .but i am getting following error.
'Error evaluating field district_count: The problem was located in calculate expression for /repeat-over-filtered-choices/disctrict_count Xpath evaluation:Instance refrenced by instance (dist)/root/ item does not exist.
@LN
yes..i did not change a thing,just converted the form to xfrom using XLSfrom app.
still getting following error in ODK validate.PFA the xfrom
">> Something broke the parser. See above for a hint.
java.lang.RuntimeException: Error evaluating field 'district_count': The problem was located in calculate expression for /repeat-over-filtered-choices/district_count
XPath evaluation: Instance referenced by instance(dist)/root/item does not exist
"
I had initially done the conversion with the latest version of pyxform and that worked without error. I also just verified that http://opendatakit.org/xiframe/ also works and hopefully will be an easy one for you to try.
I'm surprised that there would be a tool out there that doesn't do the conversion right. What tool is it exactly and what is its version?
That is very strange. I just downloaded it as an XLS document again from my link above and the conversion worked without any problems at http://opendatakit.org/xiframe/. Perhaps you could try another one of the converters listed.