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 01:48 AM
Hi,
Search for any business rule for sys_user table with Query=true
Regards
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-17-2020 06:07 AM
Hi Akansha,
Any update on this?
Regards
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-17-2020 10:18 PM
Hello Ankur,
We have update this to customer but they aren't sure that they have added any business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 02:05 AM
Hello Ankur,
Can you please tell me how can I create any business rule or any restriction so that sys_user api didn't fetch some accounts.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2020 02:29 AM
Hi Aakansha,
you can use query business rule on sys_user table; I consider you must be having a user account for API; For example: I assume you want to allow only those users belonging to the company A
Condition: gs.getUserName() == 'that user name'
Script: sample below
current.addQuery('company.name', 'Company A');
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