About nested group

I have two groups (left and right) inside a group (bilateral).


1. What is the problem? Be very detailed.
Whenever I select side = left or right, I want to retrieve respective group. When I select side=bilateral, I want to get the outermost group that encloses two left and right groups. The form is attached here nested_group.xlsx (11.5 KB) , but its not working. How to fix it?
2. What app or server are you using and on what device and operating system? Include version numbers.
I am using to https://getodk.org/xlsform/ to render the form.

Hi @sumankhanal
I think your question is unclear at least to me (no one else has answered too so probably not only to me). Could you elaborate?

If I understand correctly...

  • if side = bilateral then show both groups questions
  • if side = left then show only left group questions
  • if side = right then show only right group questions

If so, then you can remove the relevant on the bilateral_tumor_nodes group, and add or ${side}='bilateral' to the relevant for each of the side groups.
nested_group_v2.xlsx (11.5 KB)

Sorry for late reply.

Yes it is what I wanted. But I have few questions.

  1. Yes it serves the purpose now, with your solution. But now I ran into another problem. Suppose I select side='right', then last question I will get is Are there contralateral lesions in other breast?. Now if user selects yes how to get the questions about another breast (in this case left)?
  2. Isn't it possible not to display the label Data on bilateral breast cancer for name bilateral_tumor_nodes?
  3. Isn't it possible to make the most outer group (in our case bilateral_tumor_nodes) relevant only when side='bilateral'?

Thank you for your support.

  1. You can't direct the user back to an earlier part of the survey. The last question seems like a repeat of the first question. Can the two be combined and asked once at the start, in order to determine once at the start of the survey if the tumors are "none/ left/ right/ both sides"?
  2. A group label will display for everything inside that group. Any questions inside a "Data on bilateral breast cancer." group will have that group label.
  3. The condition on the outer group will be checked first, before proceeding to the inner groups. If you make the outer group ${side}='bilateral' and an inner group ${side}='left' you are essentially placing a ${side}='bilateral' AND ${side}='left'relevant on the inner group. Which is an impossible condition since the side question is a select_one.

You might want to explore repeat groups and see if that functionality might make your survey flow work.