Unable to Remove Users from Group While Implementing Scheduled Cleanup Process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Requirement
- Every month run a flow to check which group members from "Finance group" do not have an approval on the last 6 months;
- Users shall be removed from the group "Finance group" if the user has not been selected has an approver for the last 6 months;
- When users are removed, a notification with the removed users should be sent to email
Current Status
I have designed and implemented the flow, and I am successfully able to:
- Retrieve the group members.
- Identify users who have not acted as approvers in the last 6 months.
- Prepare the list of users to be removed.
However, I am encountering an error during the step where the users are removed from the group. The flow fails at the record deletion/removal stage.
Used flow properties as run as "system user".
Any guidance or suggestions would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
it's not HR related group. it's a custom application.
Flow also running on the custom application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
screenshots of the flow config and the error please
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
out of the box Can Delete is Unchecked on sys_user_grmember table
This table is in global scope
from my custom app when I ran background script it did allow me Delete Record
But it created Cross scope for READ access
Did you check that?
Also check any restricted Caller Access is stopping?
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
Thank you for your suggestion.
I tested the approach in a Background Script and was able to successfully delete the record from the sys_user_grmember table.
Additionally, I observed that no Cross-Scope Access records were generated for read access, and no related RCA (Restricted Caller Access) records were created during the operation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
since it's custom app you should be able to select that scope while running background script
Try that and don't use global there and share the error etc
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
