- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2014 07:30 AM
It appears when I enter a number larger then 10 digits into an integer field, the field is populated with 2147483647 (which interestingly enough is only one of 4 double mersenne primes). Is this a limitation of that field type?
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2014 09:20 AM
This appears to be a limitation of the MySQL database that Service Now is hosted on, I don't think there's much you can do about this. The following wiki article demonstrates that Integer fields in Service Now are saved Integer data type (no surprises there!).
http://wiki.servicenow.com/index.php?title=Introduction_to_Fields#Database_Field_Types
Looking at the online MySQL documentation, it is shown that the max value that can be stored in a signed Integer variable is 2147483647, as you have witnessed.
It may be worth raising a ticket on Hi to see if one of their DBA's can change the data type on this field to unsigned Integer (which would mean no negative values), or BIGINT. This may require a new field to be set up though, as I'm not sure if MySQL will be able to convert datatypes in this way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2014 12:56 PM
Thanks,
That explains it. I have replaced the field with a string field. Do you know how to create a validation script that will limit the input to numbers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2014 01:05 PM
var re = /^\d+$/;
var isInteger = re.test(newValue);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2017 08:37 AM
"Long" is what you are looking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2018 12:08 PM
There are two types of fields that can probably evade this limitation. One is "longint", and the other is "int" (Integer string)
The second is just an int stored as a string, I'm not certain if you can query/sort/whatev the exact same way as an actual integer. But I'm pretty sure longint is just an unsigned int or something.
"longint" should be able to do what you're looking for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2018 03:12 AM