Is it possible to paginate results with the JSONv2 web service?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2023 08:36 PM
I don't have access to the rest API and am currently running into 2 errors when retrieving records with the JSONv2 web service:
- Maximum Execution Time exceeded
or - 10,000 record row limit (glide.processor.json.row_limit)
Based on the documentation I can limit the records with "sysparm_record_count" but there is no option to offset like there is with the rest API (e.g. &sysparm_limit=100&sysparm_offset=0)
Any ideas or workarounds?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2023 01:55 AM
Hi @Mark Epps ,
I believe there's no available workaround if you're using JSONv2 unless the platform allows updating that property.
The only solution I can think of is using scripted rest API in ServiceNow that paginates the rows using GlideRecord chooseWindow GlideRecord | ServiceNow Developers.
Doing this approach may require you(API consumer) to call the API multiple times depending on the row count and each time you will be passing in the parameters for the page.
Please mark correct if this helped your concern.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2023 05:46 PM - edited ‎02-14-2023 05:51 PM
Unfortunately, I only have access to the JSONv2 webservice and the standard web UI. Running ServiceNow Rome.
I did some more googling and am testing the following two methods
- use of "sysparm_first_row" & "sysparm_record_count" briefly mentioned here: Export Report in CSV format using a script - ServiceNow Community
- Break up a large export (servicenow.com)