- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2017 07:59 AM
Hi All,
We have created a list field on our incident table called u_escalated_to.. This is a reference to the sys_user_grmember table and has a simple filter of Group is SM Managers.
When you first select the name in the list it displays correctly.
Once you save the record it is displaying as the Sys_ID
Any suggestions on how to get it to retain the name rather than the sys_id?
Any help is greatly appreciated
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2017 08:04 AM
Sorry Sam. Mistake on my part. Go to the script include and change the line:
list.push(grm.getValue('sys_id'));
to
list.push(grm.getValue('user'));
The list was creating a bad list of sys_ids.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 07:53 AM
Hi Chuck,
Thanks for the above. I have another example of a list collector I am trying to use, but this time it is on a record producer on our portal. The List Collector is a reference to the core_company table. I then have the below code to copy the information from this record producer into the description field of the incident that it creates :
if(producer.all_brands_affected !=""){
current.description = 'Brands Affected: ' +producer.all_brands_affected;
}
This however is copying sysID to the description field and not the name of the companies. Is this the same issue or is it something wrong with the above code?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 07:58 AM
That doesn't sound like the same issue. It's getting the value by default and you want the display value. Try this instead:
if (producer.all_brands_affected !=""){
current.description = 'Brands Affected: ' + producer.all_brands_affected.getDisplayValue();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 09:02 AM
Thanks that has worked fine.
In regards to the original issue on the List collector I've added to the incident form, is there any OOB functions that I could use to create the reference Qual to return the users who are members of the SM Managers group from the sys_user table, or will I need to create a script includes to run a query against the sys_user_grmember table?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 04:49 PM
Hi Sam,
There isn't anything OOB that I'm aware. You are welcome to try this bit of code that I just put together. Warning: It hasn't been tested.
From a reference qualifier, you could call it like this:
javascript:new UserUtil().getGrMemberQuery('GROUPNAMEHERE');
It should return an encoded query something like this:
sys_idINSYSID1,SYSID2,SYSID3...
////////////////////////////////////////////////
var UserUtil = Class.create();
UserUtil.prototype = {
initialize: function() {
},
// Get the encoded query for a reference qualifier
getGrMemberQuery : function(groupName) {
var memberList = this.getGroupMemberList(groupName);
return 'sys_idIN' + memberList.join(',');
},
// Return an array of group members
getGroupMemberList : function(groupName) {
var list = [];
var grm = new GlideRecord('sys_user_grmember');
grm.addQuery('group.name', groupName);
grm.query();
while (grm.next()) {
list.push(grm.getValue('sys_id'))
}
return list;
},
type: 'UserUtil'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2017 03:20 AM
Hi Chuck,
Thanks for the above, I've just tried this, but the filter doesn't appear to have worked, not sure if I've missed a section that I should have amended etc.:
Ref Qual = javascript:new getGroupMembers().getGrMemberQuery('SM Managers');
Script Includes:
Currently the list is showing all users from the sys_user table.
Any help is greatly appreciated.