You mentioned that the two questions are in different groups but I missed that in my initial explanation.
You need to include the group name because compliance_category
is in the g2
group and compliance_condition
is in the g3
group. So when you use current()/../../g2/compliance_category
as a choice filter for compliance_condition
, current()
is expanded to /test/r1/g3/compliance_condition
which results in:
/test/r1/g3/compliance_condition/../../g2/compliance_category
=> /test/r1/g2/compliance_category
You can see that the first ../
goes "out of" the question node because current()
evaluates to the full path of that node including its name.
I simplified your form a bit to test-hm20190708.xlsx (30.6 KB) and wrote the choice filter as comp_category = ${compliance_category}
. I verified that pyxform
correctly writes the choice filter as comp_category = current()/../../g2/compliance_category
and that Collect shows the expected choices. Is it possible that the problem was caused by not having the comp_category =
part? It's not clear to me why writing your own current()
expression would address that, though.