1. What is the issue? Please be detailed.
In my form I have an external csv select_one_from_file question and a subsequent text question. I am using the appearance map and it works great!
I would like to set the default for the text question to be the label for the select_one (this is essentially an opportunity to update the existing description if necessary)
The select_one_from_file works (so I know it is correctly set up)
The next question remains blank.
In the example within the sample xlsx I'm using the select_one question is called Surfacing1
In the column for default of the next question I am using: instance("surface")/root/item[name = ${Surfacing1}]/label
which in my naive understanding of XPath should evaluate to the label of the item corresponding to the value Surfacing1 from the list_name surface...
I am also trying to reference other columns in the csv, but they don't work, so let's just start with the label...
I've also tried it with an internal list as select_one (appearance minimal) and get the same result - blank next question.
2. What steps can we take to reproduce this issue?
I produced a skeleton form but it doesn't parse, so I'm a bit stuck. And yet the big form (which I'm not sharing) validates fine. Which is a bit odd. I tried adding choice_filter True() to the skeleton just in case but no joy
Response from Central and XLSForm online
Error: ODK Validate Errors:
Something broke the parser. See above for a hint.
org.javarosa.xpath.XPathMissingInstanceException: XPath evaluation: Instance referenced by instance(surface)/root/item/label does not exist
The following files failed validation:
${select-one-label}.xml
Result: Invalid
Maybe if I can get to the bottom of this, it might help? No idea why one would work and the other not!
3. What have you tried to fix the issue?
followed the documentation: https://docs.getodk.org/form-datasets/#referencing-values-in-datasets
This even has the example of picking up the label from an external dataset, so I used this as the model...
I have been able to use the following question to show the value in a label, but not set the default value of the question: Referring to a label of an answer to previous choose one question, within the label of subsequent question
This doesn't really solve my problem and adds extra columns to my dataset, so I don't see it as a viable answer...
4. Upload any test forms or screenshots below.
I'm using ODK Central 1.5.3 and ODK Collect v2022.3.6
select-one-label.xlsx (12.0 KB)
Any help gratefully received. No doubt it will be the usual problem of a minor error that I can't see for looking at.