- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-13-2021 03:09 AM
Hi,
I have a REST API call that is returning JSON that is too big(> 35MB). Now I cannot use the response as usual
response.getBody() as it will only support till 5 MB and max 10 if used a property.
So I have tried the request.saveResponseBodyAsAttachment(file). to store the large json. unitll here its storing and also getting attached to the record.
Now I need to read that file and do necessary action, while doing that I need to store that big content(> 35MB) atleast to a variable. Now SNOW do not allow string object above 32MB.
Now what technique should I use for such cases where the whole content of the big file needs to be use to do processing (create / update ) record.
Thanks,
Abhinab
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-13-2021 03:47 AM
Hi,
there will be some limitations
I would suggest to get the response in chunks so that it becomes easier to parse in ServiceNow.
the maximum attachment size that the system will return for base64 encoding for is controlled by this system property
com.glide.attachment.max_get_size property.
If the setting does not exist it will default to maximum 5 MB.
You can change this standard value as per your need. However, as mentioned in the following KB, this may cause some issues.
Large attachments may cause Out Of Memory errors and performance degradation
Regards
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
ā03-15-2021 04:03 AM
Thank you for marking my response as helpful.
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader