Why are integers now limited to 9 digits?

4231
9
07-12-2018 01:13 PM
SparrowData_Solutions1
New Contributor

The new version seems to be limiting my integers to 9 digits which means I can no longer enter phone numbers as an integer.  Am I missing a setting to make this a long or is this on purpose? #survery123 connect

Tags (1)
0 Kudos
9 Replies
ClaireProctor
Occasional Contributor

Hi Kevin,

This is on purpose, and has been for a while; the field length of an integer value is by default capped at 9, because the maximum possible 32-bit integer value is ten characters (specifically 2,147,483,647). You can extend the length of the integer field by entering a larger number in the bind::esri:fieldLength column of your spreadsheet for that question, but entering a number higher than that maximum integer value will cause an error.

What I would suggest in your case, with phone numbers, is that you instead use a text field. Your phone numbers don't need to be stored as integer values, because you don't need to treat them as numbers in calculations. You should then limit the input to that field to numbers using an input mask, which can also be used to provide some standard formatting to make the phone number easier to read. We provide an example mask specifically for United States phone numbers in our documentation on input masks: Esri custom columns—Survey123 for ArcGIS | ArcGIS 

SparrowData_Solutions1
New Contributor

Thank you for the help Claire!

ReneAubut
Occasional Contributor

Up until recently, I was working with Connect 2.8.4, and upon installing 3.2.196, got a new bug:

In Connect, an integer question receives the result of a calculation: concat('20', substr(${uniqueID},0,6))

Yields an integer value of 8 digits, example: 20190204. 


Worked fine in 2.8.4

In 3.2.196, its putting a comma as to separate thousands, ending up reaching the 9 digit value (its counting the comma as a digit...) giving me: 20,190,20 - thus missing the last digit, 4. It writes it in red indicating bad value type

Just to make sure, I uninstalled 3.2.196, reinstalled 2.8.4 and all worked fine....

Ideas ?

JamesTedrick
Esri Esteemed Contributor

Hi Rene,

Thanks for the feedback. Is it possible to change the field to text or note with an integer field type to resolve the issue?

0 Kudos
by Anonymous User
Not applicable

Hi Rene,

Try using an input mask of 99999999 on that question and the locale formatting will be ignored and you will not see the comma thousand separators. Out of interest have you set a field length on this question also, if so field length should not be used on integer/decimal question types.

Phil.

0 Kudos
ReneAubut
Occasional Contributor

Thanks James and Phil

The fastest was to try the input mask set to 99999999 and it worked!. Had no field length set.

0 Kudos
KimberlyWilsonGuinta
New Contributor

Thank you!

 

0 Kudos
TomislavTesla
Esri Contributor

Hi,

I am creating Survey123 that will be filled out by the citizens of the city and will be public. One of the questions is to fill in an 11-digit national id. I tried using the 99999999999 mask and it works fine until i use it on the web. Then the mask automatically stops working and I can type anything in that field.
Is there any other option that will control that citizens have to enter 11 numeric characters?

Thanks,

Tomislav

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Tomislav,

Input masks are not supported on the web.  You could construct a constraint via string-length or regex functions.

0 Kudos