I am running through a problem since the latest releases of survey123 (3.5 and above) with constraints.
After spending a bunch of time in connect trying to find what was wrong with my formulas in the constraint column, I figure out that the validation would occur only when I attempt to submit the form.
I first though it was a bug, but it seems that this should be the intended behavior since 3.5 and the introduction of inline validation. I could find a few posts about it, but nothing clearly stated in the official survey123 help:
https://community.esri.com/thread/205058-survey123-connect-now-constraint-not-working (See Evan's issue of august 19)
In the blog posted by Ismael for the 3.5 release, the only statement about it is the following:
Constraint and required messages now appear inline, helping you identify the exact questions in your form that need attention. This is particularly useful when you have long forms, or forms with multiple pages.
Why this is an issue:
This behavior means that the user can fill the entire form before noticing that a mistake was made.
- First of all, it is annoying to come back to questions especially when forms are long and users expect to be done with it at the end
- Calculations can still be made based on the wrong value
- The user might do (irreversible) mistake on the field before he realizes a wrong value was entered
Simple example, not so critical (could be much worse):
- User needs to indicate the maximal diameter of the components found in the ground (gravel, rocks...)
- Based on that value, the survey indicates the weight of the sample that needs to be taken
- The user made a mistake with units (cm instead of mm) and the survey indicates to take a sample of 5kg instead of 30kg
- The user proceeds, and continue the form while the sample is sent to laboratories...
I can imagine several workarounds, but nothing is worth the original constraint behavior that was before 3.5. Moreover, it means that all the existing surveys need to be updated in order to prevent users from doing mistakes.
- Use the inputMask column: very limited (cannot use regex, compare numbers (<>), use other fields or many other usefuls fonctions as the one shown here)
- Use an additional field that will show up when the constraint is no met (cumbersome, user can still ignore or miss the message, issues with layout in grid-theme)
- Use bind:esri:warning column (still, it is only a warning, not sure if all function listed in 1 would work)
Firstly I hope first that I didn't miss anything, and this is the actual intended behavior and not a bug. If so, I would like to say that the inline message is great, clearer that before. The only issue is the moment when the validation takes place.
- Is it possible to do the validation while the user is filling the field (as for the input mask column) and not once the user attempts to send the survey?
- Do you have any other workaround that would get closer to the original constraint behavior?
Thank you for your time and your help.