- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 11:22 AM
So I am creating a form where managers can request to have members removed from Groups. So, when they select a Group, I want a List Collector populated with the members of that Group, so the List Collector is based on the Group Member table (sys_user_grmember). It looks like this field does NOT have a Display Field set in the Table Design. The List Collector on my Service Portal form seems to be defaulting to showing the system creation date field, which isn't very helpful.
How can I change this to show the User field from the Group Member table? I tried using Variable Attributes, but that did not seem to work.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2019 07:40 AM
OK, I figured out a solution coming at this from a different angle.
Instead of using the Group Member table as my reference table for my List Collector variable, I used the User (sys_user) table. I then used a function in a Script Includes to build the Reference Qualifier that I need. So, the Script Includes look like this:
var GroupMembersCriteria = Class.create();
GroupMembersCriteria.prototype = {
initialize: function(){
},
allGroupMembers:function(){
//Only return active users who are members of selected Group
//get selected Group from SC Variable
var include = '';
var selectedGrp2 = current.variables.group;
//return all members of selected group
var users2 = new GlideRecord('sys_user_grmember');
users2.addQuery('group', selectedGrp2);
users2.query();
//write all members user sys_ids to string
while(users2.next()) {
include += (',' + users2.user);
}
//return criteria string
return 'sys_id IN' + include + '^active=true^user_nameISNOTEMPTY';
},
type: 'GroupMembersCriteria'
};
And then call that from the Reference Qualifier on the List Collector variable like this:
javascript:new GroupMembersCriteria().allGroupMembers()

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 11:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 11:46 AM
I already have the List Layout set up like that, so that did not make a difference.
I thought about setting the Display field directly on the Table itself, but have been cautioned about customizing settings on out-of-the-box tables. So I was hesitant to try that. I tried it, and it does work, but is there any danger in doing this? Will future upgraded change the Display Value back to False?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 11:52 AM
Ahh, now that I think about it, it is going to make a difference. Sorry I suggested that in the first place. If you set the display:true for the User field on the Groups table, everywhere this table is being used as a reference, the users would only see the User field. Not good at all since they are looking for Group information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2019 11:53 AM
It would be helpful if you can post a screenshot of where you are at with this.