sysparm_offset and sysparm_limit not quite working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 09:52 AM - edited ‎07-01-2025 10:40 AM
I am interrogating a SNOW API instance and need to request a chunk of data at a time through the query parameters sysparam_offset and sysparam_limit. It seems the limit is not honored, in that, in some cases, the actual number of results is less than the limit. This becomes problematic as I am not sure what items have been missed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 10:31 AM
Hi @markcurtis ,
Did you happen to validate the actual results in ServiceNow for the query.
If your limit is 10 and your query only return 5, then the response will only be 5 records not 10.
Please provide detailed explanation or your api request, so we can debug more.
Mark this as helpful and correct if this helps you.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 10:37 AM
As an example:
&sysparm_offset=3001&sysparm_limit=1000
The above params, in spite of the header property `X-Total-Count` saying there are 1000 elements in the results, when I count the sys_id, there are 999
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 10:52 AM
Hi Curtis,
X-Total-Count returns the total row count irrespective of the access.
You can impersonate and check if every record is readable by your API user account.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 10:58 AM
Are you suggesting that there could be items that I am unable to see? How will I determine this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2025 07:21 PM
Impersonate the account that you are using for your API call, and check if any records are removed as part of security constraints.