Select to view content in your preferred language

Constraints on empty fields in repeat

4 weeks ago
New Contributor III

I have a survey that is basically just repeat. Within the repeat there are entries required while out in the field, and others that can only be entered upon return to the office. The users must be able to cycle through the repeats while leaving the office entries blank, but I need to set it up so they cannot submit the survey until those fields have been complete.

I was able to do a workaround where I calculate a 1 or 0 for each of these "required in the office" fields, then calculate if each one is all complete, with a constraint on THAT calculation. This is a rather messy way to do it and is alot of extra fields.

 Is it possible to use a constraint directly on the original field that requires the field to be non-empty and will fire upon attempted submission? Thus far it doesn't seem to want to work, I'm assuming because it's empty. I've tried string-length(.)>0, string-length(.)!=0, and .!=''. The test case is a text field.

0 Kudos
1 Reply
MVP Regular Contributor

The required column accepts logic statements. I regularly set these up for scenarios like you described.

In my case, I have two primary calculates that every one of these "office only" questions gets:


These are linked to a single select:


And those calculates swaps the questions from "note required":


To "required":


I use the black asterisk as a visual reminder that those question will be required at some point.

0 Kudos