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:
${num1}='' is FALSE
${num1}=NaN is FALSE
number(${num1}) is BLANK
string-length(${num1}) is 0
string-length(number(${num1})) is 0
string-length(string(${num1})) is 0
here is the survey with the num1 field empty:
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.
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.
Thanks,
Tom S.
P.S. ${num1}=null is FALSE, ${num1}=undefined is FALSE as well.