Cases are not removed after repeat_count was reduced (KoBoCollect). ALL previous cases stay visible and active. Also the count() is not updated.
Steps to Reproduce
See XLSForm attached, with Remarks. BugIV_02.xlsx (31.7 KB)
Import form and open it
Enter 3 for Total of HH members
Fill names
Go back and reduce Total, e.g. to 2
You will still see all previous cases
Finalize and save and re-edit
You will still see ALL previous cases.
Expected behavior
Cases of repeat_group should be reduced, to the new repeat_count
As it works in Enketo/Preview (in default style)
Actual behavior
All previous cases are still there. This will not change, if you finalize, save and re-edit.
More information
This has been previously reported and discussed at on this Kobo forum thread. I'm opening a post here because Josh pointed out that this is a better place.
Thanks a lot, @danbjoseph ! I like the approach described in that discussion, even though it feels more like a workaround than a solution to me.
I'd love to see a bit more discussion about the intent of this feature. In my experience, the current behavior is somewhat problematic:
It generates inconsistent data.
What's worse, there is no way to decide how to resolve the inconsistency: I don't know whether the repeat count is too small or whether there are too many repeat instances. The enumerator has no way of telling me.
Similarly, even if I knew that there are too many repeat instances, I don't know which ones to keep. I could arbitrarily keep the first n-1, but that might not be what the enumerator wanted.
In my experience, explaining this "feature" to enumerators is really tricky. They don't understand why their change to the repeat count has no effect.
I think a good next step would be to see whether there's a logical and reasonable way to get the behavior achieved with the inner group with relevance without having to do a form design trick. I'm not sure how feasible that is. The core team won't have time to prioritize this in the short term but it would be a welcome contribution.
My preferred solution would be a warning popup that appears when the repeat count is reduced. Something like: "Changing <variable name> will delete <x> instances of <repeat group name>. [Yes, delete] [Cancel]"
That might be a little tricky to implement since the variable might be linked to a repeat_count in complex ways... but maybe it would be enough to handle the common case where the repeat count is ${variable name}.
Thanks, @Sjlver, looking at the PR linked from the issue described above should get you in general area. You'll see we discussed the concept of a warning when the repeat count is reduced and that it would require a fair amount of restructuring.