My team recently encountered a bug in our Survey123 Survey that I wanted to share here to see if anyone else has experienced similar issues, and to possibly report the bug to the software team.
Details of workflow:
The buggy behavior on iPad that we have been experiencing is that in one of our surveys in the Survey123 field app keeps crashing after 5-10 photos have been taken, losing all data. It also has a slow processing behavior where it won't render the first tap on the screen but then processes it after the second tap. This lag creates a difficult UI for entering data and results in data errors.
I was able to narrow in on the lines in my xls form that were causing the issue and get our survey back on track. I realized that it was just the presence of a calculation field within a repeat that is counting the number of repeats. When moved to outside of the repeat itself, the issue goes away.
After more troubleshooting though I am realizing that it is slightly less simple than I thought. After testing it more, it seems as though when the survey only has one or two repeats, the bug isn't present even if the calc field is within the repeat. I created some generic forms to demonstrate the issue. Here is the breakdown of the files I am attaching:
I am hoping that maybe this can help someone else who might be trying to do a similar thing in a survey. Also maybe by logging this it can get flagged as a bug to maybe bring up a syntax error without letting the user publish a survey that will result in data loss when used in the field.
System Details:
Publishing a survey from desktop Survey123 Connect on PC Windows 10 (version 3.19.116)
Running into bug on iPad iPadOS (17.4.1) on Survey123 Field App (v2.19.121)
If you check the log file in the app it shows thousands of lines that repeat over and over.
Thanks Doug. Between this and this thread, I managed to resolve this error.
Removed all the position(..) and used count(${field}) outside of a repeat where ${field} in a repeat has 1 as default and calculation.
Maybe the form will still crash, only time will tell. But at least it's one less problem!
Funny I just tried to use position(..) in a repeat again this week and I get the symbol and warning in Connect still. Really does not like it.
Changed back to once(count()) no issues. @mikaël make sure to add a once otherwise if you scroll back through the repeat it can change on you.