- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 04:50 AM
Hi All,
I have 2 field Members (List Collector) and Group Name (Reference) in a catalog item.
Whenever a requester selects a group so in the Member field the list of users in who is part of that group should populate as options to select.
Kindly, help with the scripting.
Thank you..!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:07 AM
something like this in advanced ref qualifier
javascript: var query;
var arr = [];
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", current.variables.group_name);
gr.query();
while (gr.next()) {
arr.push(gr.getValue('user'));
}
query = 'sys_idIN' + arr.toString();
query;
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
11-01-2023 05:32 AM
Should script Include client callable or no?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:38 AM
No, it should not as we are calling it from reference qualifier...!!!
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 05:40 AM
no script include required.
Did you check my above response? It will work fine for you
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader