REST API table query - "sysparm_no_count" doesn't fetch all records.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2023 12:51 AM
I've recently added "sysparm_no_count=true" to "sys_attachment" query, for performance reasons.
With offset "0" it works as expected:
curl -H 'Authorization: Bearer <TOKEN>' 'https://<INSTANCE>.service-now.com/api/now/v1/table/sys_attachment?sysparm_no_count=true&sysparm_limit=100&sysparm_offset=0'
With offset "100" it works as expected:
curl -H 'Authorization: Bearer <TOKEN>' 'https://<INSTANCE>.service-now.com/api/now/v1/table/sys_attachment?sysparm_no_count=true&sysparm_limit=100&sysparm_offset=100'
With offset "200" it fails with "No Record found":
curl -H 'Authorization: Bearer <TOKEN>' 'https://<INSTANCE>.service-now.com/api/now/v1/table/sys_attachment?sysparm_no_count=true&sysparm_limit=100&sysparm_offset=200'
With offset "200", when sysparm_no_count=false" it works just fine:
curl -H 'Authorization: Bearer <TOKEN>' 'https://<INSTANCE>.service-now.com/api/now/v1/table/sys_attachment?sysparm_no_count=false&sysparm_limit=100&sysparm_offset=200'
It seems like it is a bug, unless I am doing something wrong?
Thanks!
0 REPLIES 0