
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 01:55 AM - edited 02-07-2025 01:57 AM
Hi Guys.
What I am doiung is I have ceated an Assigned to (sys_user) field and a Assigned Group (sys_user_group) field on a the sc_cat_item form & what I am trying to do is flter the Groups field based on the assigned to (user) selected. So only show groups that the user selected is in.
My initial idea was to try this via a reference qualifier and a script include:
So I tried:
javascript: specificGroupUsefulUtils().getGroups();
with the following script include: specificGroupUsefulUtils
and script (I have removed specific field names):
How to select only users of a specific group into a reference field - Support and Troubleshooting
Thanks in advanced for any help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 02:56 AM
it's a field and not variable, so this will work
current.u_assigned_to
javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.u_assigned_to).getMyGroups());
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 02:03 AM
no scripting required
in the 2nd variable use this advanced ref qualifier
javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.variables.assignedToVariable).getMyGroups());
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 02:33 AM - edited 02-07-2025 02:35 AM
Hi, Thanks for your response but this did not work for me.
I put the following in the reference qual field and it didnt work:
javascript: 'sys_idIN' + new global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.variables.u_assigned_to).getMyGroups());
It returned a blank list of fields from the reference field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 02:43 AM
this is for catalog or normal form?
Does that assigned to user has groups associated?
Is that group variable a List collector or Reference? share variable configuration screenshot
The solution I shared above has worked recently where community member did confirm the same
How can i dynamically populate a List Collector on Service Portal?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 02:45 AM
did you test with admin?
If the group variable is list collector then ensure you add variable attributes
ref_qual_elements=u_assigned_to
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader