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

Dr Atul G- LNG
Tera Patron

Might be helpful

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0996223

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************

  1. In the flow, locate the step that looks up sys_user_has_role records for the user.
  2. Add a condition: Inherited = false.
  3. Run the flow.

The flow only fetches and deletes the roles that are not inherited (Inherited = false) from the user profile. The system also deletes the associated roles that have Inherited = true. 

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************

Try this @n-ssurabhi 

****************************************************************************************
Regards
Dr Atul G. - Learn N Grow Together ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
******************************************************************************************

Ankur Bawiskar
Tera Patron

@n-ssurabhi 

which group is this? Normal or HR related?

share screenshot of that error of flow step

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