- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 04:20 PM
I am trying to show users from 2 groups for a reference field , Came across this article which is working If I use sys_id of one group but not working when used 2 groups , What am i doing wrong
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0831564
javascript:'active=true^sys_idIN'+getIDs("74b1b52d1b4bdd10320c535b234bcb1f","fcb1b52d1b4bdd10320c535b234bcb12"); function getIDs(grp){var m=GlideUserGroup.getMembers(grp);var ids=''; while (m.next()){ids+= (m.user+',');} return ids;}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 05:25 AM
Fixed with other approch
In the Reference variable , Select group member table and use the group sysID , this will fix the issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 09:56 PM - edited 07-20-2023 10:01 PM
Hi @RudhraKAM ,
For 2 groups. Please try below:
javascript:'active=true^sys_idIN'+getIDs("74b1b52d1b4bdd10320c535b234bcb1f","fcb1b52d1b4bdd10320c535b234bcb12"); function getIDs(grp1, grp2){var m1=GlideUserGroup.getMembers(grp1);var ids=''; while (m1.next()){ids+= (m1.user+',');}var m2=GlideUserGroup.getMembers(grp2); while (m2.next()){ids+= (m2.user+',');} return ids;}
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 05:00 AM
Hello Rahul , This is showing all the users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 05:18 AM
All user means, Whole sys_user table?
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 05:30 AM
I'm looking for the same solution and tried it out and yes, with your code it's showing all users from sys_user table.