Size limit for JSON and XML parsing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2015 03:02 PM
I'm trying to parse a large body of data, and have been unable to do it using JSON.parse or XmlDocument2 due to its large size.
Javascript compiler exception: WrappedException of java.io.UTFDataFormatException: encoded string too long: 278472 bytes in: ....
Is there a system setting I can use to turn this up or another API to get around this limitation? I'm on Fuji patch 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 04:27 AM
Hi Nikita,
ServiceNow has some limit in terms of variable size/length. If you want to process large files then you can use mid server and then write a mid server script include to parse the xml and return the parsed values back to servicenow ecc queue. once you receive the ecc_queue entry from mid server you can do whatever you want for the values.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2017 06:50 PM
String data type max length is limited by ServiceNow since Fuji. In Fuji, Geneva ad Helsinki it is limited to 16Mb. Since Istambul it is 32Mb. Keeping in mind that we may have 2 bytes allocated for a char the effective limits are 8/16 Mb respectively.
There are undocumented system properties that can help overcoming the limits. I will not disclose those here, my advice to those who are insterested to raise a /hi ticket referencing an error you get (java.lang.RuntimeException: String object has exceeded max size of 16777216), providing your use case for a long string and asking for a way to remove the limits. The support guys will help you.
Thanks
Nikita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2017 05:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2017 02:18 AM
Hi Dan,
Would it be possible for you to share your code?
I'm trying to achieve the same exact thing, and it would be a great time saver to have your code as a basis to help write mine.
Thanks for the help you can provide.
Regards,
Olivier