Autopopulate Group name when user is selected in requested for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 04:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 05:12 AM - edited ‎12-20-2023 06:38 AM
i am creating a catalog form and requested for is a variable and when any user is selected then in the My group variable it will show the list of groups which i am member. and currently i am using reference type and sys_user_group is the reference .please guide me @Ankur Bawiskar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 07:18 AM
You need to do this
I assume group variable is reference type and not list collector
1) add this in the advanced ref qualifier on group variable
javascript: 'sys_idIN' + global.ArrayUtil().convertArray(gs.getUser().getUserByID(current.variables.requested_for).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
‎12-20-2023 08:24 AM
Its is still showing all the groups not the one i am member of.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 05:25 AM
Hi @kamlesh ,
One way would be to write a client script & script include to getch all the groups user is part of then using addOptions in client script populate the field My group membership if its a select box type.
Else
U can write the below thing in reference qualifier under type specification of My Group membership variable
javascript:user='+current.variables.requested_for
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2023 05:41 AM
It is showing created dates in the list .