I have two questions (cascading selects) within a repeat group. I've limited the repeat to 5, but I also need to require at least one answer (a city). I believe I need to put an expression in the constraint column, but I can't get it to work.
I've attached a sample XLSForm that I adapted from the Cascading Selects sample. Any help would be appreciated.
Solved! Go to Solution.
So do you mean you want at least 1 of the 5 to have a value and you have repeat count of 5?
Outside the repeat add a join() which creates a list of values. Then add a string-length() > 1 constraint to make sure at least something is in there.
A field with count() then constraint of > 0 would also work.
Hope that helps.
So do you mean you want at least 1 of the 5 to have a value and you have repeat count of 5?
Outside the repeat add a join() which creates a list of values. Then add a string-length() > 1 constraint to make sure at least something is in there.
A field with count() then constraint of > 0 would also work.
Hope that helps.
Initially, I was putting the constraint on the same line as the "select_one cities" field and that didn't work.
Eventually, I figured out that I had to put the constraint on the line as the calculate (count or join) and it finally worked.
Thanks for your help. I really appreciate it.