Script to check if user is part of existing group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 09:17 PM
Hi Team,
I have a requirement where I have 2 fields existing groups and add new group. In existing group I'm populating the groups which are already mapped to user. Whereas in the field Add New I need to populate the groups which are not mapped for the user and he should select only those groups.
Note both are of list collector variable types. Below is the script
Script Include :-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 01:41 AM
Hi Vishal, Same script I have copied, existing groups it is showing same for every user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 02:01 AM
Hi Revathi,
Can you share screenshot of script include and reference qualifier...Please...
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
02-22-2024 02:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 02:35 AM
All looks good....!!
It's strange...why its not working...
Can you put some logs in script include and check if you are getting the groups in array...!!
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
02-23-2024 04:53 AM
It is working for logged in user, however when we try to change requested for value its always quering logged in user only due to getUserID();