Hello everyone,
Long-time community user, first time posing a question here. I'm working on a survey that will utilize a constraint formula within a repeat to prevent duplicate values from being selected in a select_one question. The values being stored are text codes (i.e. WEAT for Weather, POWR for power failure, etc.). I've tailored a constraint formula from other posts (shout out to Doug) to prevent duplicate responses from being submitted within the repeat. To account for the optional "additional hazards" choice, I added an exemption for that stored value. The formula is:
not(contains(substr(${hazard_duplicate}, 0, string-length(${hazard_duplicate}) - 2), ${hazard_type})) or contains(${hazard_type}, "ADD")
I've been testing the formula within Connect with it visible as a "text" field and it works as intended. I want the field to be hidden from respondents now that it's working. When I try to hide the field though, the constraint no longer functions and duplicates can be submitted. I've tried changing the field type from text to hidden, leaving it as a text field with a hidden appearance and changing it to field type note with a hidden appearance. None of these options allowed the constraint to function while hidden. I also tried changing the bind::type and bind::esri:fieldType to string and that did not work while the field was hidden either. Will this formula not function when the value is set to hidden? When a field is set to hidden, is something added to the stored value that is preventing the formula from working? See the attached file for the survey. Any help would be greatly appreciated!
-Matt