Creating Flow for Removal of Inactive Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2025 05:55 AM
I need to design a flow for removing inactive users based on certain conditions. The criteria for removal are as follows
and here I cant get the assignment groups in the flow
Users where:
Active = false, and
Last Updated is more than 1 month ago, and
They are members of specific groups (group memberships need to be removed).
The group memberships to be considered for removal are:
Specific group memberships
All assignment-group memberships (i.e., groups with Type = ITIL) and should log a delete actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2025 11:33 PM
I need to remove inactive users from a specific group, and also those inactive users present in all assignment groups. I’m currently stuck on creating the conditions to achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2025 11:36 PM
please delete your other question as it's a duplicate one
Also you are already remove inactive users from specific group, the only part pending is assignment groups
Do this
1) use Lookup records on task table
2) Then use For Each and iterate and lookup on Group member with this user and the task assignment group
3) then delete the Group member record
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2025 11:44 PM
You have asked this question 3 times on the community. Why? This will run you the risk of getting the same answer multiple times. In none of the duplicate questions you mention what you already did and what you already tried.
The flow you show, needs to be updated to have separate look ups for the sys_user_grmember table and the sys_user_has_role table. Because if any inactive user has a role, but no group (shouldn't happen because of best practice, but you never know), it won't remove the single role. So get the sys_user_has_role loop out of the sys_user_grmember loop.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark