Table api sys_user is not returning all accounts or retuned wrong total account
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 11:55 PM
Hello,
As we are calling Table API for fetching user data (sys_user). where in code i am taking total count of the user with X-Total-Count. And we are using this api https://your-instance.service-now.com/api/now/table/sys_user?sysparm_limit=10000&sysparm_offset=0 for pagination.
As one of our customer have 61189 users (this value is returned by X-Total-Count) but when they are calling this api
https://your_instance.service-now.com/api/now/v1/table/sys_user?sysparm_limit=10000&sysparm_offset=6...
it is returning only one user. it should return 15 accounts. Why this api is not returning all accounts or it is returning wrong total user count. Please help me with that.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 12:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 01:21 AM
what are the results of your diagnistics? - we are getting all user account from this 14 account.
how many records do you see from the table list? - As this issue is coming on our customer env. so I am not sure that how records are actually there
Is the query or X-Total-Count incorrect? - I am doubtful for this.
Is the instance domain seperated? - I don't know. please let me know how can i check this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 12:13 AM
Hi,
check any query business rule is restricting the record count.
whether table is domain separated?
For example, the first time you call the endpoint, sysparm_offset is set to "0". To simply page through all available records, use sysparm_offset=sysparm_offset+sysparm_limit, until you reach the end of all records.
in your case limit is 10000;The third party should send the sysparm_limit and sysparm_offset.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 01:18 AM
yes, we are sending sysparm_offset+sysparm_limit. And it is working fine for other customer.
how can we check the any business rule is restricting account. can you please tell me the exact steps for do that.