Constrain integer field to be not empty

Esri Contributor

by TomSchwartzman

Esri Contributor ‎07-28-2020 12:09 PM

I have an integer field called num1. Has a default of zero. But you can erase that zero and leave the field blank. This blank field is not considered an integer (kills calculations for instance).

I want to put a constraint on it so you don't leave it empty (i.e. no number, no text). I can't seem to do it.

I have tried testing to see what this "empty" integer field is interpreted as, and I can tell you this:

$='' is FALSE
$=NaN is FALSE
number($) is BLANK
string-length($) is 0
string-length(number($)) is 0
string-length(string($)) is 0

here is the survey with the num1 field empty:

empty

survey

and here with the num1 field with a valid number:

I tried using any of these in a constraint (e.g. string-length(.)>0 ) but that is ignored, or not seen as an issue as it happily lets me submit with this blank integer field.

s

Is there a way to constrain it?

I have worked around it by using a calculation in another field, but was hoping I would not need to do this.

survey123 xlsx attached.

P.S. $=null is FALSE, $=undefined is FALSE as well.