String index out of range exception with an inbound JSON callIssue <!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } .title { color: #D1232B; font-weight:normal; font-size:28px; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } ul{ list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --> Symptoms When performing the below inbound call on JSON API from browser on the incident table, we see an error with the exception - "{"reason":null,"error":"String index out of range: -10"}" and the incident records were not retrieved in the browser results Inbound API Call: https://<instance name> .service-now.com/incident.do?JSONv2&sysparm_action=getRecords&sysparm_query=active=true&displayvalue=true Exception in the browser with the above Inbound call: Release Issue reported on Kingston Patch 12 but the exception is irrelevant of the product version. It can trigger on any version if the table field types were not configured correctly Cause There exists a custom field named "xxxxx" on the task table which is of type counter for which the expected values should be date/time values.It is observed that the values for this field on the task table ranges between 0 and 17 which are of type Integer. The platform code is expecting this to be a date/time value and does a substring starting at position 11.Since the current integer values which you've got for this field were less than 11 characters( Not the Date/Time Values), you see an "String index out of range" exception when tried to query the incident table using JSON API Resolution The solution is to change the type of above mentioned "xxxxx" custom field on task table from "counter" to "integer string" and then run the JSON call. This should retrieve the incident records in the browser results successfully.