Nested repeatable groups only allowing child repeatable groups for first record in ODKCollect

1. What is the problem? Be very detailed.
I am new to ODK and just testing out whether I could create a form to allow data capture in the field. This data will require nested repeat groups. I have created a basic form and deployed it on the ODK Central sandbox. I can then download the form on to ODK Collect and start entering data.

I can enter data correctly for my first repeatable group, however I can only enter data for the second repeatable group for the first record in my first repeatable group. Similarly I can only enter data for my third repeatable group for the first record in my second repeatable group. That is, for all my repeatable groups the option to add a child repeatable group only appears for the first record - the second and subsequent records don't show the option to add a repeatable group.

This only seems to be a problem in ODK Collect - the web version of the form seems to allow child repeatable groups for each record of a parent group - a public link is available here: https://sandbox.central.getodk.org/-/single/tNfNXNq5NMbe1uGEeIQeQu4SgK78w8a?st=4t7!du2PFlD8RDVrzaeULyP0sv5C2p!yXisR9Zg2D5ZojSNLRhM1Bk3TFj4wBpgg

2. What app or server are you using and on what device and operating system? Include version numbers.
The form is deployed on the sandbox ODK Central. ODK Collect is v1.27.3 running on Android 10

3. What you have you tried to fix the problem?
Nothing further - I'm still at the stage of evaluating whether ODK will be suitable for my needs.

4. What steps can we take to reproduce the problem?
I have attached my form definitionTest-form-djc-1-export (2).xlsx (19.7 KB)

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
Form definition included above - its deployed to the sandbox so I should be able to send you the config information to download the form to ODK Collect if required.

Thanks in advance,
Dave

Hey Dave! I tried out your form and couldn't see any problems. Could you maybe post the steps you're going through one by one and where you run into problems?

Hi,
Ok, using ODK Collect I "Get Blank Form" successfully, then choose "Fill Blank form".
I can then fill in the "Name" and "Sampling location" fields.
I can then choose the "Sample metadata" repeatable group - this puts 1 entry in place and allows me to edit it. I can edit the "Vessel" and "Gear" fields. It also has a child repeatable group: "Species metadata". I can see this on the first entry in the "Sample metadata" group:


If I add a second entry in the "Sample metadata" repeatable group (i.e. I want to record data for a different Vessel/Gear) then the "Species metadata" repeatable group is not present:

This seems to be the case for all the nested repeatable groups in my form on ODK Collect - they only appear for the first record of their parent group.

Maybe it's a stupid question but did you add Species Metadata for that second Sample metadata group? If so is it present if you navigate through the form and just disappears in the hierarchy view?

1 Like

For the second record there is no way to add the Species Metadata - the option just doesn't appear. This seems to be the same behaviour for all the child nested groups - they work correctly for the first parent record but there doesn't seem to be a way to add them for the second or subsequent parent records.
I will try using the same form on ODK Collect on a different phone and see if the behaviour is the same.

I see the same behaviour for the form on a different phone (also running Android 10 and ODK Collect v1.27.3).

I think this is what's happening I'm getting the same thing if I use the hierarchy view to create the second "Sample metadata" and then try and add a "Species metadata" inside it, again using the hierarchy view. @davidcurrie2001 Usually (in my understanding) people fill in forms by swiping to get to the next question. You'll see if you go through the form this way rather than hitting the arrow (:arrow_lower_right:), which takes you to the "hierarchy view", you'll be prompted to create the "Species Metadata" and "Data" where you'd expect.

I think you've discovered a quirk here where the repeatable group isn't showing in the hierarchy view because you haven't "created" it yet. I'm amazed this hasn't been found before but I guess because the hierarchy view is usually used for people to go back and edit things it's a rarer problem. I'm going to dig into this further and file an issue in Collect (https://github.com/getodk/collect) once I've got a better understanding.

EDIT: You can also use the plus (:heavy_plus_sign:) button while filling in the form to add a new repeat.

Ok issue created: https://github.com/getodk/collect/issues/4059

@seadowg I didn't even realise you could swipe through the form :- S You're right when I do swiping I can add in the nested groups - thanks for clearing this up - thanks also to @Grzesiek2010 for the input. It would definitely be nice for the "hierarchy" view to have the same behaviour as the swiping.
I will try and create a more realistic form now and see if I can capture the data we work with.
Cheers.

Ha yeah it's not the most "discoverable" feature. There is definitely a problem here outside the hierarchy view I've realised as you shouldn't be prompted to create the first nested repeat in any group - it should be there for you (according to my interpretation of the XLSForm docs). Thanks for taking the time to post about it here! I hope you get a real form working!