Needs to populate only the Groups which Requested For field User ID is not added
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 07:21 PM
Can you please help me @Vasantharajan N
As need to populate only the Active Groups and the Groups which the Requested For field User ID is not added.
As off now created the below script, but it's working based on the User who is raising the request form and it's showing only the Active Groups which is fine.
As it should work based on the Requested For field User ID.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 09:15 PM
You need to make a client callable script include through which you can query the sys_user_grmember table to get the list of groups for which the requested_for is not a member of and then call the script include from your reference qualifier.
Please refer below posts which will help you to do the configuration :
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 09:50 PM
@Arjun Reddy Yer Unfortunately, getMyGroups is only available for logged in user, since you would like to get the groups for requested for, you need to write a script include method, query Group Member table to get the groups of the requested for user.
Let me know in case you need help on the scripting part.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 03:41 AM
Step 1: Update your advanced reference qualifier to javascript:"active=true^sys_idNOT IN"+new ScriptIncludeName().getGroupMemberOf(current);
Make sure you replace your script include name where you will have the logic defined in step 2 given below.
Step 2: Define function to return the list of groups the user is member of.
getGroupMemberOf: function(currentRec) {
var groupList = gs.getUser().getUserByID(currentRec.variables.requested_for.toString()).getMyGroups();
var sysIds = [];
for(var i = 0; i < groupList.size(); i++) {
sysIds.push(groupList.get(i).toString());
}
return sysIds.join();
}
Step 3: Test the functionality
Thanks & Regards,
Vasanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 04:24 AM