Nested repeat groups returning wrong position(..)

Hi everyone! I’m having a weird issue in a form with nested repeat groups. I’ll attach a simplified version and try to explain here. There is an outer repeat group containing a question where I select domain 1 or 2. Then there is a relevance condition on whether to show the nested repeat group - it shows for domain 1 and not for domain 2. So here’s how the issue happens:

  1. Start entry for the outer group (outer group position = 1)
  2. Select domain 2, so no nested repeat is shown for the first iteration
  3. Repeat the outer group (outer group position = 2)
  4. Select domain 1, so the nested repeat shows
  5. The nested repeat has incorrect position(..) information. The first item in the repeat shows the outer group position as 1, inner group position as blank. Then the 2nd item has outer group position as 2 (correct) and inner group position as 1 (one less than it should be). And it increments like that. This is messing up all the downstream logic and calculations.

Is there something wrong with my structure, or is this a known bug? I’ve found a few posts with similar issues but not exactly this. Appreciate your help!

PS: It won’t let me upload the XLS sample because I am a new user, so here it is as cut-and-paste:

type name label::Português (pt) required appearance choice_filter calculation relevant repeat_count
start start
end end
begin_repeat domaine 4
calculate outer_repeat_position false position(..)
select_one Q006 Q006 Outer repeat: List of domains false
begin_group page_001 Nested repeat. Outer repeat position: ${outer_repeat_position} false ${Q006} = ‘Q006.1’
begin_group page_Q1 false field-list
begin_repeat repeat_Q1 Question 1 4
calculate inner_repeat_position position(..)
note show_repeat_Q1 *Outer repeat position: ${outer_repeat_position} Inner repeat position: ${inner_repeat_position}*
end_repeat
end_group
end_group
begin_group page_001_3 No nested repeat false ${Q006} = ‘Q006.2’
begin_group page_Q23 false field-list
note note_1 *Outer repeat position: ${outer_repeat_position} No inner repeat*
end_group
end_group
end_repeat

Welcome to the community, @rs3524! Could you kindly share your sample XLSForm with us? This will make it easier for the community to help troubleshoot your issue.

Hi Kal, thanks for following it up. I posted the form as a table in the previous message because I’m a new user and it won’t let me add an attachment. Also uploaded to Google Drive here.

This is no longer urgent for us - we replaced the nested group with 5 copies of the same question instead of using a repeat group. But I’d be interested to hear the solution if you know it!