sysparm_offset and sysparm_limit not quite working

markcurtis
Tera Contributor

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.

9 REPLIES 9

YaswanthKurre
Giga Guru

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

 

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

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.

markcurtis
Tera Contributor

Are you suggesting that there could be items that I am unable to see? How will I determine this?

Impersonate the account that you are using for your API call, and check if any records are removed as part of security constraints.