Table API pagination bug, brings back empty pages with "next" link when next query has results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2025 12:05 AM
Hi,
According to the REST Table API Version Differences - Support and Troubleshooting (servicenow.com) documentation, version 2 recommends stopping pagination and understanding that an empty array indicates no results.
However I have encountered an issue where and instance receives an empty page when there are still more results available. When querying the next page, results do appear (with the link.next header)
We suspect this might be related to our use of the ORDERBY clause on the sys_created_on field, though your documentation seems to support this. Without a reliable way to detect when there are no more results, it becomes challenging for us to upgrade to v2. We’d prefer not to rely on header links, especially since they are missing when we add the sysparm_no_count parameter to the query.
This is the url of the query we are performing and wish to get full results to:
Additionally, we’ve noticed that the page sizes have decreased (for example, we’ve set limit=100 but received 14) and we’re wondering if there have been any changes in this behavior.
please. help me understand how can I query for the results and get 100 by 100 until there are no more result and not get partial or empty pages that stop my pagination.
to clarify, I query for 100 (where there are alot more results left, and get 0, then in the next page I get more.)
** it happens both in v1 and v2
what could be the reason?
thanks