- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2020 11:28 AM
Hey folks,
I have a requirement for a catalog item where I need to populate the list of group members in the right bucket of the list collector as per the group selected in a reference field above.
The form looks like this as of now :
The first field is reference to "sys_user_group" while the list collector is showing the users with a simple reference qualifer which says "active=true^user_name!=empty".
What I'm basically trying to achieve is to edit the group members (add or remove) using this form; I know that could later be achieved via the workflow, but as of now I'm struggling with this. I've tried plenty of scripts available in the community, but none of them seem to be working for me.
Any slight help would be really appreciated! Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2020 01:14 AM
The code which I'm trying is below :
Client Script :
group_members is the name of the list collector
Script Include :
Any slight help would be highly appreciated, thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2020 11:35 AM
Hi,
You could set the glide_list attribute on the List collector to make it behave like a normal platform List field. Once the attribute is set, you can set comma separated sys_id's of users directly using g_form.setValue('') without any complex scripting in it. Also it will work on service portal as well.
ie g_form.setValue('list_field' , '1,2,3,4,5'); // comma separated sys_id's of user.
Thanks,
Kunal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2020 11:45 AM
Hi Kunal, thanks for responding ..
Yeah, you're right, that can be done and would make the task at hand a bit easier. But I also want the end-users to be able to add users to the group .. which I thought I would do by using the list collector. I mean I'll have the list of all the users on the left and the group members on the right ..
Is there someway we could achieve this using the glide_list as well ?
Also, the most important thing I want to ask here is;
How do I populate the list of users of a selected group ? 😞 I'm unable to do so !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2020 12:19 PM
Hi Akash,
Here you need to write an onchange client script, and a script include to do server side call. In the server side code send the value of sys_id's in a comma separated string. Now in the client script call back function set the value that you got from server.
Thanks
SreeHarsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2020 10:38 PM
Hi Harshav, thanks for the guidance, I understand we may need to follow this path. However, I'm unable to fetch list of group members from a group ! 😞