Repeat count Problem

Hello ODKers,

I am facing a problem in case of repeat count. The repeat count is dynamic depending on an entry. If I enter a value for example say 2, the group will repeat for 2 times. But, if I go back and change the number to say 1, still the group repeats for 2 times only. I am using the style as pages. Will this effect the repeat count in any way?. Please suggest me a solution for this. I am attaching an example form for reference. I have tried using calculate field with sum() but it was not successful.

Thanks and Regards,
SGSC

It works let's say "as expected" despite the fact that it might be a little bit confusing.
I mean if you use repeat_count and you increase the number of repeats it works well and new repeats are added (they are empty) but if you decrease the number of repeats you need to remove additional groups manually.
We were discussing the problem here: https://github.com/opendatakit/javarosa/pull/61 and we decided that the risk of accidental data loss is to high. You know someone could remove filled groups by accident decreasing that number.

1 Like

Hi @Grzesiek2010,

But it has different behavior in Enketo right?.

Yes in Enketo it's possible.

Thanks for the reply.

In particular, @SGSC, I recommend reading through the "repeat-groups are not respecting the jr:count setting after a change" section at https://opendatakit.org/help/form-design/workarounds/. There's also an XLSForm with the general technique of using relevance to hide those extra repetitions at https://github.com/opendatakit/collect/issues/868#issuecomment-302466153.

2 Likes