SELECTED not working

Hello! Hope you can help me on this I'm still new in ODK, I've used the 'SELECTED' in my (others, please specify --TEXT) field whenever I choose "others" on the question "Is the barangay located in the plains/upland/coastal area?" and it worked.

But when I am trying to use it on the "Are there puroks/sitios in the barangay?"
question,

the next set of questions
What are the puroks in the barangay?
What are the sitios in the barangay?

doesn't appear when I chose "Yes".

Thank you!

Survey.xlsx (11.8 KB)

Hi, @Makino,

You may check the relevant column section in row 13 &14 and add these command selected(${puroks}, ‘1’), selected(${puroks}, ‘1’).

You may test your form in this link "https://getodk.org/xlsform"

Regards,
Bernie

Hello @Bornok, should I delete the relevant in row13 and 14 and replace with those command?

Because I got this error:

Error: ODK Validate Errors:

XForm is invalid. See above for the errors.
: Encountered a problem with display condition for node [${purok1}] at line: selected( ${puroks} , '1'), selected( ${puroks} , '1')., Bad node: org.javarosa.xpath.parser.ast.ASTNodeAbstractExpr@694e1548

The following files failed validation:
${Survey}.xml

Result: Invalid

It's okay now. I replace it with

selected(${puroks}, ‘1’) per row.

Thank you so much! @Bornok :smile:

1 Like

I am facing a problem with relevant commands which I put as follows (selected(${pos_mother}, '1')) or selected($acute_covid, '1') or selected($illness, '1') or selected($infl_synd, '1') or selected($infl_marker, '1') or (selected($no_other_infl, '1') and (${sum_param} >= '2' and <= '6')) or (${exp_cov} = '1')
I need the question to be displayed if the above conditions are fulfilled, but it says invalid.

Encountered a problem with display condition for node [${consent}] at line: (selected( ${pos_mother} , '1')) or selected($acute_covid, '1') or selected($illness, '1') or selected($infl_synd, '1') or selected($infl_marker, '1') or (selected($no_other_infl, '1') and ( ${sum_param} >= '2' and <= '6')) or ( ${exp_cov} = '1'), Bad node: org.javarosa.xpath.parser.ast.ASTNodeAbstractExpr@131276c2

Could you please help me how to solve the problem?

This is incorrect syntax. Try instead:

...and (${sum_param} >= '2' and ${sum_param} <= '6'))

@Xiphware Thanks a lot for your response. I've already fixed the issue....