Hello,
I'm experiencing unexpected behavior in one of my forms that I can't explain.
In my form, I have 2 nested repeats:
First repeat (to add quadrats):
- Users select species from a list
Second repeat (nested within the first):
-
Repeats based on the number of species selected for the quadrat
-
For each species, users choose an abundance value
At the end of the second repeat = Calculation of the sum of abundances
Then end of the first repeat
The issue: My form works perfectly on the ODK Collect mobile app, but not in Enketo. In Enketo, the sum of abundances accumulates progressively as I add quadrats (first repeat), instead of being calculated separately for each quadrat.
Example:
I've attached my form file for reference.
CIMaE_Quadrat_repeat.xlsx (299.0 KB)
Has anyone encountered this issue or have any idea what might be causing it?
Thank you!
Hi Guillaume
I have tried your form a few times in Enketo and I can’t reproduce your error. There are often small things that don’t work quite as expected in Enketo.
However, why use nested repeats? In my opinion having a repeat within a repeat creates challenges when it comes to data processing and management, it is far cleaner to have just one repeat if possible.
I certainly might have missed something but I don’t see any good reason to have nested repeats in your form. You could take out the first repeat and just open a new form to complete the second repeat each time data are entered.
Hello Paul,
Thank you for testing my form. On my end, I can reproduce the bug when selecting abundances. Please see the attached images.
First repeat : 35 + 65 = 100 it’s ok
Second repeat : 25 + 50 = 75, not 175
Regarding the use of repats within repeats: what I've shared here is only a small portion of my form. The full protocol actually requires this nested structure to properly capture the data we need.
I'll continue investigating to identify the root cause of this bug. For now, I've removed the constraint to prevent users from being blocked while using the form.
Thanks again for your help, and have a great day!
Guillaume
When I ran it first I tried this tool (it is an old tool but still good I think) https://getodk.org/xlsform/ with the form you uploaded and the example that you have above and it works correctly, I get 75 for the second value.
In ODK Central, I get 175 as you do above.
I don’t know if there is something in the form logic that is processed differently between these two tools.
I am sorry I don’t have more ideas
Thank you, Paul, for this additional test. I hadn't thought of that, and it's interesting.
For me, this confirms that the bug comes from Enketo's interpretation of the form in Central.
Do you know how to see the versions of Enketo used by Central and https://getodk.org/xlsform/?