Survey123 one field OR another must be filled in "Required"

237
4
Jump to solution
02-26-2020 11:24 AM
BradGeorgic
New Contributor III

I have 2 fields one called email and the other phone.  I want to make it so that either one of them have to be filled in for the survey to be sent.  How do I set the required and constraint fields?  Any help is appreciated

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Frequent Contributor

For these it always ends up in a dependency cycle.  So I use a 3rd field like this.

typenamelabelhintconstraintconstraint_messagerequiredrequired_messageappearancedefaultreadonlyrelevantcalculation
textfieldAfieldA
textfieldBfieldB
calculatecheckfieldscheckfields.!=''Must fill out fieldA or Bcoalesce(${fieldA}, ${fieldB})

Someone may have another idea.  Hope it helps.

View solution in original post

4 Replies
DougBrowning
MVP Frequent Contributor

For these it always ends up in a dependency cycle.  So I use a 3rd field like this.

typenamelabelhintconstraintconstraint_messagerequiredrequired_messageappearancedefaultreadonlyrelevantcalculation
textfieldAfieldA
textfieldBfieldB
calculatecheckfieldscheckfields.!=''Must fill out fieldA or Bcoalesce(${fieldA}, ${fieldB})

Someone may have another idea.  Hope it helps.

View solution in original post

BradGeorgic
New Contributor III

Doug Brwoing with the WIN!  Thank you that solved it!

0 Kudos
RichardBuford
New Contributor

How did you solve this. Which one is set to required?

0 Kudos
DougBrowning
MVP Frequent Contributor

Neither is set to required.  You instead set the constraint on field 3 to !=''.  This will fire if both are blank but not if either one has a value.

0 Kudos