Repeat count not limiting number of answers enumerators can enter

1. What is the problem? Be very detailed.
In creating a survey through Excel, I have a question asking how many girls were present at each school. The next question asks the enumerator to take a photo of each present girl. This is where I would like to limit the repeats to the number of girls listed as present in the previous question.

I thought I could do this by putting in " . <= 11" under repeat_count OR constraint, but neither limits the amount of groups/entries the enumerator enters. Perhaps I am coding wrong - can someone please help?


2. What app or server are you using and on what device and operating system? Include version numbers.
I am using a Toshiba, Firefox, and Excel to develop this survey.

3. What you have you tried to fix the problem?
I have tried putting the limiting number of repeats under repeat_count and under constraint.

4. What steps can we take to reproduce the problem?
I don't know..

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.

Hi @caseykennedy
welcome to the forum! Please introduce yourself here!

You can use Dynamic repeat counts and repeat that photo question as many times as you answered in a previous question.

Thank you - that doesn't seem to work though. For the example you gave, the begin_repeat line has the repeat_count formla - whereas in my example, each school has a different number of girls present, and therefore the repeat count changes depending on the school... Is there a way around this?

So every school should have its own repeat group? Am I wrong?

Yes basically - but only one school will be chosen from the list of schools to monitor at a time. Ie. The monitor visits one school, selects that school, then takes attendance (list of girls from that school is in choices), then takes photos of each of the present girl. How best would you set this up?
The way I have it set up, they can add as many groups as they want for each photo and it's messy..

So you have a separate list of girls for each school and for each school you allow selecting multiple girls (from the list) and then you want to take a photo of each selected girl. Am I right?

Yes exactly. But I only want to take a photo of each girl who is present at the school that day.

Ok could you elaborate on this too?

If you have let's say 3 schools:

  • school1
  • school2
  • school3
  1. A user selects school1
  2. A user sees a list of girls let's say 10
  3. A user select's those present at the school let's say 8
  4. A user goes through a repeatable group with 8 repeats to take photos

what then a form is saved or you want to do the same for each school on the list?

Yes, you have it exactly right. After completing one school and taking the photos of the present girls, the enumerator/monitor will save and send the form. When they go to the next school, they will begin a new form.

What about something like this: schools.xlsx (7.0 KB)

Wow that is incredibly helpful - thank you! I have incorporated some of your tips into my survey but am encountering problems. I have attached it for you to review if possible?!

I am also now getting "Unexpected KoBoCAT error 400: {"detail":"[row : 57] Unmatched end statement. Previous control type: None, Control type: repeat"}" when I try to deploy it on Kobo.

PLFv9.xlsx (28.4 KB)

In that row 63 you have end_repeat but there is no repeat you can end, I mean every previous repeat already has its end, please review it carefully.

Thank you for noticing. I am still having difficulties, as the survey is not limiting the number of photos it is requesting to take of the "present girls" despite including "image under Repeat Count. After asking for a photo of the girls present, the next screen asks for a photo of ___ (with no name). PLFv10.xlsx (28.0 KB)

Does that happen in every case or maybe if you select let's say 3 girls, navigate forward and then navigate back to unselect some of them? Your form seems fine, I extracted that part you highlighted and it works well. What version of ODK Collect are you using?

No, regardless it happens. If you select the right amount of girls the first time, it will ask for a photo of a __(blank) girl too..

Do you or anyone have any suggestions?

You can refer to values from the last saved record of this form definition:


This can be very useful when an enumerator has to enter the same value for multiple consecutive records. An example of this would be entering in the same district for a series of households.

Sorry I dont think that will solve this problem. The problem here is that the enumerator is asked to select_multiple for each of the girl who are present in one question.

The next question asks the enumerator to take a photo of each of the girls that he/she had previously selected in the select_multiple. But there is a glitch, because in addition to all the girls he had previously selected, it asks the enumerator to take a photo of (blank) girl after each of the girls where a name had replaced the (blank).

Why is this happening? I have attached the sheet.PLFv10.xlsx (27.9 KB)

Does the problem occurs in that yellow section? (I'm sure it is but can't reproduce) What ODK Collect version do you use?