Flow Designer -- Removing inactive users from groups/roles

Alex Edmiston1
Giga Guru

I'm looking to use flow designer to remove users whose state changes from true from assignment groups and remove their system roles... has anyone done this before/know what table you would use for the action?

1 ACCEPTED SOLUTION

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Alex,

You could definitely do this with flow designer. I mocked something up for what you could do for deleting group memberships and hasrole records:

find_real_file.png

View solution in original post

15 REPLIES 15

Is there any limitation on Delete Record action on how many records it can delete in one execution. I'm using "Lookup Records" action and it returns thousands of records, it has OOB max result specified as 1K but flow execution throws error "Internal Server Error" while testing flow. 

However, if i reduce look up records max results to 500 or less than that, it works fine. Any idea why its behaving this way. 

 

For the look up for User Role Records stage I recommend adding the inherited is false condition.

The reason being is the deletion of the inherited roles will cause the flow to error out at the last stage of the flow.

The error for the last step of the flow is caused by the flow attempting to delete inherited roles in which the records cannot be deleted.

Below is what the Look Up users Roles Records condition should look like 

 

find_real_file.png

To find Look up Records, you have to type the whole thing out or it will not appear unless it is a recent selection.

uwnewbie
Tera Expert

I'm trying to achieve something similar, but my trigger is a schedule that runs daily checking if there are some inactive users that need to be removed from groups.

However this flow results in an error, when I run it as 'system'.

It only seems to work as long as I trigger it as admin manually .

Any idea how to solve this?

Biji
Tera Contributor

HI,

I also have same issue, when I run it as System flow will not update record.But if I run it as admin it will work. Did you get solution for this?

 

Thanks,

Biji