Indexed-repeat used in a repeat nested in a repeat returns wrong value


(Fanny Vessaz) #1

Hi community,

I have been looking extensively for solutions but can't find any, so I will try to explain my issue here and hope someone can figure out what is wrong. In advance thanks!

What is the problem? Please be detailed.
So. I am building a XLS form for fisheries catch monitoring. Several catch types are selected (i.e. tuna, mackerel, etc), then there is a set of repeated questions for each catch type selected (let's call it "catch_repeat"). Within this repeat group (catch_repeat), I have a nested repeat for individual lengths of each fish (length_repeat). Now this length_repeat question is repeated based on the number of fish per catch type, max. 5.
Now my issue is that the form works fine as such, expect that when publishing to GoogleSheets, the parentID for the length_repeat does not link to anything - I would assume it would link to a catch_repeat specific ID (for each catch type).

So, as I tried to fix that, I created a unique ID for each catch type in the catch_repeat (based on fisher name, time fishing etc).
Then I am using indexed-repeat in the length_repeat so that it returns that catch_repeat_ID, and I can then link the length_repeat data with the catch_repeat data on GoogleSheets.

Now after submitting data, and published on GoogleSheets, the length_repeat_ID that is returned for each length does not correspond to the catch type. Screenshot below (highlighted are what should be the different lengths of 3 catch types, however we can see the repeat_ID is not the same per catch type). It seems it is looping through the different catch_repeat_ID available, and I don't understand the error - is that due to the jr count setting for length_repeat? That it is a nested repeat?

Any help would be highly appreciated!