Calling Script include in reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 05:32 AM
Hello everyone,
i am not able to see the see the user which i set in script include.
Can anyone help ?
Script include :
Name : CZTest
API Name : global.CZTest
Code :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 06:11 AM
Hi @anmolvishwa ,
Can you return the array as a comma-separated string value:
getValidUsers: function() {
var array = ["62826bf03710200044e0bfc8bcbe5df1", "5408091a3b100300e81d47b334efc452"];
return 'sys_idIN'+array.toString();
},
Also, add the 'sys_idIN' while returning the string or you can add the same in the reference qualifier also -
javascript: 'sys_idIN'+new CZTest().getValidUsers()';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 06:44 AM
Hi Anmol,
The script is returning the array of sys ids, which is not ideal.
Format of simple ref qualifier: sys_idIN<user1sys id>,<user2sys_id>;
So the script should return the output like above.
Eg: return 'sys_idIN62826bf03710200044e0bfc8bcbe5df1,5408091a3b100300e81d47b334efc452';
Please update the script and let me know how it goes.
Regards,
Siva

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 06:47 AM
Is the script include Client Callable?
Does the user running it have the role necessary in the script include's ACL?
If all that is correct, change your reference qualifier to this:
javascript:var ids = new CZTest().getValidUsers(); "sys_idIN" + ids.join(', ').toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 06:49 AM
this will work in advanced ref qualifier
javascript: 'sys_idIN' + new CZTest().getValidUsers().toString();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader