For some inexplicable reason the required field for my groups is no longer working. I have a simple require condition for each of my groups
selected(${consent_check},‘yes’)
Yet, even though the answer to the question ${consent_check} is ‘yes’, the groups are not appearing. What’s even more bizzare, is that when I run the exact same xls form through ODK validate (ODK - XLSForm Online) the form works correctly! It’s only not functioning through the kobo platform.
In one group, I had used nested parentheses in the required field and that seems to break everything.
For example:
selected(${consent_check},‘yes’) and (selected(${unit_level},‘individual’) or selected(${unit_level},‘household’))
The reason I had used nested parentheses is that, without them, I’m not certain that the groups would trigger correctly without them. In the above example, what I want is for the group to trigger when consent is given and the unit level is EITHER individual or household. Without parentheses, the group triggers without consent if only the last condition, unit_level=‘household’, is true.
It’s odd that the nested parenthesis works in ODK validate, and even more odd that using nested parenthesis appears to prevent other groups from triggering, even if the syntax for latter groups doesn’t use nested parentheses.
Thanks for your suggestion. Unfortunately it doesn’t work.
I cannot fathom this problem. In fact, it doesn’t appear to be parentheses at all now, so my earlier conclusion was incorrect.
For some reason, after a certain point in the form, if there is any syntax in the required field for a group then the group does not show.
The first handful of groups work fine, but at group 7, it doesn’t work. Even if the syntax in that group is exactly the same as in prior groups–e.g. “selected(${consent_check},‘yes’)”
I ended up rebuilding the entire survey row by row.
The issue was a lone calculate field. It was an “if” statement that was incorrect. For whatever reason, this caused the issue with the groups and relevants.
So, now people know… if you make a mistake in a calculate field, this can be an outcome!
Thank you @sjed1 for sharing your solution to the entire community and making the community a learning and sharing platform. Expecting the same in the upcoming days too.
Unfortunately I didn’t save a version of the XLS with the offending syntax. I do recall that it was a fairly complex nested IF statement, For whatever reason I made an error that wasn’t picked up by the validation but still broke the survey.