REST api not pulling back all records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2020 06:45 AM
running an api call to pull all hardware records
$uri = "https://cscglobaldev.service-now.com/api/now/table/cmdb_ci_hardware
There are 14K records in the table.
Only 5K are getting returned (so the 10000 limit isn't even applied yet).
Any thoughts on what would minimize the retrieval?
Thanks in advance.
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2020 10:55 AM
Hi .. I found this information interesting, yet, the REST API is paying no mind to the limit=10000.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2020 09:38 PM
Fetching high no of records in one go will impact performance of system. Try in chunks as below.
/api/now/table/incident?sysparm_limit=3000&sysparm_offset=0
the next one
/api/now/table/incident?sysparm_limit=3000&sysparm_offset=3000
the next one
/api/now/table/incident?sysparm_limit=3000&sysparm_offset=6000
refer KB - Exporting Bulk Data from Servicenow via REST Web Service Pagination
https://hi.service-now.com/kb_view.do?sysparm_article=KB0727636#:~:text=Web%20Service%20Pagination.-,Procedure,which%20default%20value%20is%2010000.
Regards
RP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 07:55 AM
Hello,
In the article ServiceNow says "You can put that in a loop to get all the records using pagination until all the records are read" do you have any idea on how to do this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2020 02:17 AM
Hi JJ,
instead of getting all table could you limit the number of fields you requesting? By the way the more fields you request in your call the less will be the limit. 10000 is probably only for a couple of fields.
https://cscglobaldev.service-now.com/api/now/table/cmdb_ci_hardware?sysparm_fields=operational_status
I'm currently experiencing the same issue with my REST API calls that are being cut after a first iteration (I'm doing it as recommended with offset and limit). This started to happen a week ago, HI ticket is under investigation.
Have a nice one!
Regards,
Ivan