Repeating group within a repeating group

Is there a way to get one repeating group of questions embedded within a second group of repeating questions? For example, I need a group of repeating questions that repeat for each building on a construction site and then also a set of repeating questions for each room within each building. Thanks for your help.

1 Like

Hi @justinrolfs,

Welcome back to the community! Would you mind drafting a short question maybe 5-10 and provide an instruction on which questions should be repeated under a specific question. Maybe the community could help you out if it’s possible.

Have a great day!

Here is a link to the example form. Repeating questions within repeating questions While the form seems to work through a web browser on my computer, it doesn’t work as intended on an Android device. The intent is that the user inputs the number of buildings surveyed and eventually answers a question that asks for the number of pictures of the building that should be uploaded.

Hi @justinrolfs
Could you please provide more information with screenshots of what you are seeing in the two platforms (Enketo and KoBoCollect) so that we can best understand the issue at hand.

In essence, the repeat within repeat should work. The complexity comes when you are trying to reference one of the embedded repeats. One needs to be very keen in this kind of scripting.

Stephane

1 Like

I’ve attached a screenshot of what I see when previewing the form through a web browser on my computer and the form seems to be behaving the way that I would expect. However, when I go to KoBoCollect on my Android phone and input the number of pictures that I want to upload for this building, I get the following error. A screenshot of the error is also attached to this message.

Hi,
Could you do one thing, on the main group, please remove the appearance field-list, this should sort out your problem.

Stephane

1 Like

Great. Thanks for the help. I think that this is what I need.

1 Like

After trying this out a bit more, it looks like this doesn’t quite solve my problem. The appearance field-list keeps questions together and shows the questions on the same screen. If I don’t have field-list within the code, all questions have their own screen which is not what we want. We want to keep questions grouped together and also have a set of repeating questions within field-list. Is this possible to do?

Hi @justinrolfs
You have to get a trade-off between keeping questions on the screen and having a repeat group within a repeat group. At this juncture, this is entirely dependent on what you prioritize between the two.

Stephane

That’s what I was afraid of. It’s not possible to have a repeating group of questions within a repeating group of questions and keep things on the same page. Thanks for looking into this limitation for me.

1 Like

Hi @justinrolfs,

Kindly please be informed that i checked it out (repeat within a repeat) with a sample xlsform designed as follows (and works smoothly in Enketo, KoBoCollect v1.27.1 and ODK Collect v1.27.3:

In the survey tab of your xlsform:
Image 1001

In the choices tab of your xlsform:
Image 1002

Reference xlsform:
Repeat within Repeat.xlsx (10.6 KB)

Could you try it out as outlined in the above Collect android apps. It should work smoothly. My hunch is that you are using an old version of the KoBoCollect android app (i.e. before v1.25.1).

Have a great day!

1 Like