Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2021 11:38 PM
Can anyone please explain me how to filter the users from only one group in reference fields reference to sys_user table.
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2021 11:53 PM
Hi,
you need to use advanced reference qualifier on that user reference field
javascript: 'sys_idIN' + new GetGroupMembers().getUsers();
Script include
var GetGroupMembers = Class.create();
GetGroupMembers.prototype = {
initialize: function() {
},
getUsers: function(){
var arr = [];
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group.name", "ABC Group");
gr.query();
while(gr.next()) {
arr.push(gr.getValue('user'));
}
return arr.toString();
},
type: 'GetGroupMembers'
};
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
10 REPLIES 10
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 05:23 AM
This might be Old post but just adding other option, so that some one can use it ,
In the Reference variable , Select group member table and use the group sysID , this will fix the issue
