
- 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:52 AM - edited 02-07-2025 02:53 AM
Hi Ankur
Both variables are reference fields
The user I am selecting to test this is a member of 4 groups
- 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 03:03 AM
Not really sure what you changed there but it worked that time lol.
Thanks for your help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 03:04 AM
Ahhh it was current.<<field>> not current.variable.<<field>>
Thanks