Integer field is truncated when the survey is saved then edited

2050
15
02-05-2019 03:44 AM
GrahamStobie1
New Contributor III

Hi

I have an integer field in a survey that is used to store an 8-digit 'ID' field - e.g. 12345678. However if the user collects some values including the ID, closes the survey without sending, then re-opens it to edit/complete the survey, commas are added to the ID, the value is truncated, and the value shows as invalid - i.e. the ID above would be now show as 12,345,67 and would be in red text. (see attached).

I understand that this is because of the 9-character integer field limitation, but as far as I can tell this is new behaviour (or the survey team have changed their workflow...). Is there a way to stop this happening? We have already collected >1000 surveys using this form so I want to avoid changing the ID field to text if possible.

Thanks

Tags (2)
0 Kudos
15 Replies
by Anonymous User
Not applicable

Hi Adam,

I had a look at the log file and can not see anything too obvious to explain why Connect crashes. Can you share your xlsx file and any csv files in media folder? I would like to try and reproduce the issue on my machine and have a more in depth look at your survey and the expressions you are using.

Phil.

0 Kudos
AdamDaily
Occasional Contributor II

Philip, I found the error in here, please disregard. I've got it working now. Thank you. 

AdamDaily
Occasional Contributor II

How do you account for variation in attribute length? So a mask of "9999" works for a 4 digit number, but if the values in this field vary up to say 6 digits, this will not work for a 5 or 6 digit number. That goes the other way as well, so a "999999" mask will work for a 6 digit number, but will not work when entering only a 4 digit number. What is the correct format for different length values into an integer field when having to use inputMask?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Adam,

The Input Mask specification supports defining a permitted but not required character - in the case of numbers, use a '0' instead of a '9'. 

0 Kudos
AdamDaily
Occasional Contributor II

James,

The masking does not seem to function as indicated by the table. "0" reacts the same way "9" does, only permitting a specific number of input characters, "0000" for exactly/only a 4 digit number. "0" is also stored as a text value if more than one is used. Converting "0000" to number changes it back to a single "0", which does not work. 

I tried "n" and "x" and "#" as well with the same results (only works when the number matches exactly the number of input characters. Example: value "8200",  inputMask "9999","nnnn", or "xxxxx" work (add 1 "x" for the comma). If my formula is shorter than "nnn" for "8200", the last 0 gets cut off. If it is longer, "99999", the program returns "Invalid Integer" error.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Adam,

In the Excel sheet, remember to specify that this a text string of 0's - the easiest way to do that is to prepend the string with an apostrophe (i.e., '000000 ) - this works for me to submit a 4 digit text string

0 Kudos