- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 07:04 AM
I have a field on the form "Executives" and I want to use reference qualifier to show a specific group 'exec_group'. I can reference the 'user' in the reference but how do I filter through to show just the user group with select few users?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 07:21 AM
You need advanced reference qualifier for this. Create a script include and put this script in there
function GetExecutiveMembers(){
var id=[];
var gr= new GlideRecord('sys_user_grmember');
gr.addQuery("group.name","your group name");
gr.query();
while(gr.next()){
id.push(gr.getValue("user"));
}
return "sys_idIN"+id.join();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 07:12 AM
Hi Neal,
Are you created two different fields to show group and group members for this?
If you are using different fields to show group and group members then you need to make your second field dependent it means where you are showing group members in a group.
Same like assignment group and assigned to field which are present OOB.
Refer below thread hope it will help you.
Reference Qualifiers - ServiceNow Wiki
Regards,
Swapnil
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 07:18 AM
No, just one field that says 'executives' and I want that to reference user group 'exec_group' (executives group)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 07:28 AM
Hi Neal,
If you are using one field to show only those users which are present in 'exec_group' then follow below steps to fulfill your req.
1. First create your custom role(For e.g. Exec Role).
2. Assign your custom (Exec Role) created role to 'exec_group'.
3. In Executives field reference qualifier add below condition:
Ref qualifier: Roles is Exec Role(your custom created role)
Hope it will help you.
Regards,
Swapnil
PS: Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2016 07:21 AM
You need advanced reference qualifier for this. Create a script include and put this script in there
function GetExecutiveMembers(){
var id=[];
var gr= new GlideRecord('sys_user_grmember');
gr.addQuery("group.name","your group name");
gr.query();
while(gr.next()){
id.push(gr.getValue("user"));
}
return "sys_idIN"+id.join();
}