- 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:26 AM
Thanks for the reply Abhinay, but I was trying to stay away from doing a script include. Is there a way to get around without doing the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 08:24 AM
Thanks Abhinay,
I've got the script include built, how do I call that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 09:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2016 07:23 AM
PAtel,
If you would like to restrict the values that are queried to the members of a specific group of users by using an Advanced Reference Qualifier then First a GLOBAL Business Rule must be created:
function getSpecificGroupMembers(group_sys_id) {
var answer = '';
var group_members = new GlideRecord('sys_user_grmember');
group_members.addQuery('group', group_sys_id);
group_members.query();
while (group_members.next()) {
answer += ',' + group_members.user.sys_id;
}
return "sys_idIN" + answer;
}
Then, the "Reference qual:" Dictionary attribute must contain: javascript:getSpecificGroupMembers("<sys_id_of_the_desired_group>");

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2016 09:25 AM
Did you get this working?