Description
I need to restrict choices already selected from a repeat group exactly as described here: Restrict choices already selected from a repeat group
and here: Preventing duplicate entries in a repeat loop
The two solutions given are good but do not work on Kobocollect and Enketo when trying to add more than 2 instances of the repeat group. If you add 3 instances of the repeat group and try to send the form it throws an error.
Steps to Reproduce
- Download Restrict choices already selected from a repeat group.xlsx and upload it in a new project
- Preview the form with Enketo or deploy it and use it with Kobocollect
- Add at least 3 instances and try to validate data or save it on Kobocollect to see the error.
Expected behavior
The expected behaviour would be to prevent the user to repeat one-select answers in repeat groups.
Actual behavior
The control on duplicates works fine while filling the form but it does not let me finish the form because of an error thrown.
Additional details
*Your environment, why you think this might be happening.
I think that the error comes from the constraint being checked twice (once when the values are entered and once when the form has to be sent). The first time the constraint is met while the second time is not. How do I overcome this problem? Is this a bug?
Thanks!