Remove users from a group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have script which works fine to remove users from a group when an admin places a request but fails when ITIL/end user places a request.
In order to mitigate this, I have created a subflow and trying to call it from the workflow.
In the subflow, I am using the sys_grp_members to extract the group and user relationship. The subflow works fine for single user and removes it from the group but fails when there are multiple users.
Please suggest how to achieve for multiple users.
Also how to call a subflow from a workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Ahoy @Rachael12,
have you tried to see the flow execution? it's good source of details for debugging. In your flow there's "test" button in the top, go for it and select a request (can be used several times, no need to always create new test records) and it oculd give youe some insights...
Answers generated by GlideFather. Check for accuracy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Rachael12 ,
Check ACL role on your Delete ACL on sys_grp_members plus Write ACL on sys_user_group.
Definitely ITIL ( end user should not have this permission) user does not have this permission.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
are you iterating a list collector variable?
share some more details
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Ankur,
Yes, users to remove is a list collector.
1. I am fetching the group member records through group == 'group name'
2. Once I have the records, I am converting group members list from array to string.
3. Then, I am running for each item in 2, delete
Issues: 1. It is comapring users' sysID with record sysID
2. Its only taking child0