Displaying User Count Works on Scripts - Background but not on Client Side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2025 10:26 AM
I am encountering an issue while attempting to retrieve the number of users in the "Network" group using a Script Include and GlideAjax in ServiceNow. Despite implementing the logic to query the sys_user_group and sys_user_grmember tables, the response returned to the client script is null.
Steps Taken:
Created a Script Include (GetNetworkGroupUserCount) that queries the "Network" group and counts users.
Verified the exact group name in sys_user_group and confirmed users exist in sys_user_grmember.
Checked logs (System Logs > All), but the response in the client script remains null.
Ensured the Script Include is marked as "Client Callable" and properly formatted for GlideAjax.
Current Issue:
The expected value should be the total number of users in the group, but the client-side script is receiving null instead.
Debugging via gs.info() in the Script Include shows the correct count in logs, yet it does not return properly to GlideAjax.
Would you be able to provide insights into why the response is not being retrieved correctly? Any suggestions on debugging or possible misconfigurations would be greatly appreciated.
Thanks in advance for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2025 12:16 PM
Hi @GeorgeConsS,
Could you please share screenshots from your script include and your client script?
If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2025 03:37 PM
Hello here's the scripts for each
Script Includes:
Client Script: