Constraints Still Apply For Empty Non-Required Fields

2583
6
Jump to solution
09-29-2016 02:34 AM
WengNg
by
New Contributor III

Hi All,

I have a question in the form which is a not a required field but with an applied constraint. When i tried to submit the form, the form still complains that I need to enter a valid entry even though I left it blank.

How do I force the form not to apply the constraints if the field is empty or not required?

Thanks a bunch !

Weng

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Thanks.

We will need to look into this one.

I just wanted to state that Survey123 at this moment will enforce your constraints even if the question is left with no answer.  There is nothing wrong with your survey. Logically, we would want to ignore constraints in non-required questions that are left empty. We will look into this and see if we can resolve in a future update. In the meantime, I strongly recommend that you open a Tech Support incident referencing this thread.

View solution in original post

6 Replies
IsmaelChivite
Esri Notable Contributor

Please attach your XLSFile so we can have a look and indicate what version of the app you are using. Thanks!

0 Kudos
WengNg
by
New Contributor III

Hi Ismael,

Please see example below in the attached XLSFile.

When you try to submit the form without typing anything into the email address, it complains that the email address is invalid because a constraint was applied to it although the field is not required.

I'm using version 1.7.35

Thanks,

Weng

0 Kudos
IsmaelChivite
Esri Notable Contributor

Thanks.

We will need to look into this one.

I just wanted to state that Survey123 at this moment will enforce your constraints even if the question is left with no answer.  There is nothing wrong with your survey. Logically, we would want to ignore constraints in non-required questions that are left empty. We will look into this and see if we can resolve in a future update. In the meantime, I strongly recommend that you open a Tech Support incident referencing this thread.

WillRumley2
New Contributor

Weng, 

 

I have logged an enhancement request regarding this issue with using constraints in non-required fields in Survey123. The enhancement number is ENH-000099729In the meantime, I've developed some workarounds that might suit your needs while we wait for an update:

Workaround #1 - Create another survey question prompting the user to designate whether s/he wishes to submit their email address by selecting 'Yes' or "No.' User could then designate the constrained email field to only appear if user selects 'Yes.' This can be accomplished by entering the following string into the "relevant" field of the email response survey question in Survey123 Connect. If the user selects 'No,' the optional constrained field does not appear and the user is able to submit form answers normally. An example of this workaround with an example of valid input:

Workaround #1

Workaround #1

Workaround #1


Workaround #2 - Enter an example email such as "example@domain.com" as a default parameter in the default field of the optional constrained email survey question. If a user does not wish to log their email information, they can simply avoid the question entirely and leave the default. After responses are gathered, administrators could filter out the "example@domain.com" responses. An example of this workaround:

Workaround #2

Workaround #2

I hope this helps!

ichivite-esristaff

WengNg
by
New Contributor III

Thanks Will,

We are already using one of the workarounds (setting a default value) that you have mentioned.

Hopefully this will be fixed in the next release.

0 Kudos
DamianMilne
New Contributor II

Why not just add "or NULL" to your constraint statement. For example, if your value must be greater than zero then your expression in your constraint field would be:

.>0 or NULL  

0 Kudos