Record count not matching with Servicenow while fetching using API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi All,
I am trying to fetch record count from ServiceNow via Postman using table API but the record count is not matching.
Table: cmdb_ci
API: /api/now/table/cmdb_ci?sysparm_count=true
Count in ServiceNow: 1125994
Count in Postman: 11259877
Table: incident
API: api/now/table/incident?sysparm_count=true
Count in ServiceNow: 48913
Count in Postman: 49680
Using OAuth2.0
Could anyone of you please help me to solve this issue.
Regards,
Shivani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
hi @Shivani29 ,
Make sure there is no sysparm_query or other filter applied in the UI when you get the ServiceNow count.
Check the ACLs for the OAuth user. The REST API runs as the authenticated user, so ACLs can affect which records are accessible.
Make sure you're comparing the same instance and the same table. This is especially important for cmdb_ci because it is a parent table and can have inherited/extended CI records.
Try running the same encoded query through the REST API and in the list to compare like-for-like.
Also check whether the UI count is coming from a list/report/dashboard that applies additional filters or conditions..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16 hours ago
Hi Tejas,
Thanks for reply. I will check as you suggested for ACLs. I have checked and there is no filter on UI. Also, I am comparing the same instance and table.
Regards,
Shivani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
any query business rule is restricting the records?
did you try with admin credentials and see?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
16 hours ago
Hi Ankur,
Thanks for reply.
I have given admin access to the user which I am using for API . Checked business rules but nothing is there.
Regards,
Shivani