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-21-2024 09:26 PM
It is working fine, if variable type is single line/Multi line text. Issue is when variable type is list collector

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 09:31 PM - edited 02-21-2024 09:33 PM
Hi @Revathi12
Change the code as below:
groups1.push(gr1.getValue('group'));
List collector is the field that contains string of sys_ids and can't access display name of the group, so you have to make it work by using the sys_id instead of display name.
Also, one suggestion, instead of doing this validation on client script, why don't you create a reference qualifier on the "Add new group" field, which only shows the list of group which is not in "Existing group" list.
Let me know your thoughts on this.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 09:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2024 09:49 PM
Can you pls help me with reference qualifier condition.