Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

Unable to Remove Users from Group While Implementing Scheduled Cleanup Process

n-ssurabhi
Giga Contributor

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.

     

11 REPLIES 11

it's not HR related group. it's a custom application.

Flow also running on the custom application

 

@n-ssurabhi 

screenshots of the flow config and the error please

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@n-ssurabhi 

out of the box Can Delete is Unchecked on sys_user_grmember table

This table is in global scope

AnkurBawiskar_0-1787223585208.png

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?

AnkurBawiskar_1-1787223741654.png

Also check any restricted Caller Access is stopping?

 

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

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.

@n-ssurabhi 

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

AnkurBawiskar_0-1787227450340.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader