- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2024 12:30 AM
Hi All,
Could I please have your help for the below requirement.
We have a form from which we can add new groups to the existing users who are already part of groups. Upon user selection, slush busket will be made visible where the "Selected" section will display the groups where User is already part of.
We are now trying to make those values populated under the "Selected" section Ready Only but could not find any way to achieve the same. Please advise if we can achieve this. If this cannot be achieved, can we have other slushbucket in the same form so in this one will display the values existing groups user is part of and shlould not be editable and in the another "Selected" section - user can add the groups they have to be added.
Thanks in Advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 07:38 AM
To exclude groups from the Available list that the user is a member of will require replacing the reference qualifier conditions with one that calls a Script Include, like this format:
passing in a variable value for the user. The Script Include would do a GlideRecord on the list reference table to replicate the conditions you have now, pushing the results (group sys_ids) to an array, then another GlideRecord on the sys_user_grmember table to make an array of group sys_ids that the user is a member of. Finally, use ArrayUtil to remove groups (sys_ids) from the first array that are present in the second array and return the results like
return 'sys_idIN' + finalArray.join(',');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2024 03:34 AM
How about an alternate approach where after the groups are auto-populated in the Selected box, nothing appears different, but you have an onChange script that will check if one of these values is removed, then add it back, so users won't be able to remove any of the pre-populated records. It might appear to be removed for a second or so before the script puts it back.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 05:34 AM
Hi Brad,
Thank You for the inputs. We have created one other field to populate the existing groups and made it ready only and this way it is working for us.
Now the left side list collector is still showing the groups user is already part of.
Can you please help to correct this situation, so that the "Available" part of list collector should only show the groups user is not part of.
Thanks in Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 05:48 AM
This would involve updating the reference qualifier on the list collector variable. Do you have an existing one that calls a Script Include, or is this just showing all groups or something like that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2024 06:46 AM
Hi Brad,
We have the reference qualifier for the list collector with condition like active=true, role/name/type of group should not be "ABC" like that. Also we have the onchange client script which get the existing group of user and display it in the right bucket(which we have now added a line to clear this existing value from right bucket).
One more point to add, in the left bucket, only certain values of existing group is populating and few others are not showing up as expected.