Deactivate groups with No users using Flow Designer

RahmatSharH
Tera Contributor

Hi Everyone,

 

Can anyone please help me out how to deactivate the groups which has NO Users using Flow Designer. I have tried but not able to get the desired results. Please find the attached screenshot for reference.

 

Thanks in advance

1 ACCEPTED SOLUTION

@RahmatSharH 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@RahmatSharH 

you can do this

1) Lookup Records on sys_user_group

2) Then use For Each on Step 1

3) Then Lookup Records on sys_user_grmember with the Group from Step 2

4) Use IF and check outcome is Success or Failure

5) If failure means no user present

6) then use Update Record and deactivate the group

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Ankur Bawiskar
Tera Patron
Tera Patron

@RahmatSharH 

something like this

deactivate group is no member.gif

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar , 

Thank you for the information. I have updated the flow as you have shown, but i am not getting desired output. when i ran the attached script getting 17 records which has no users, but when tested with flow count 2 is showing which has users. flow logic should show the groups which has no users If i am not wrong!

 

RahmatSharH_0-1742474881688.png

 

@RahmatSharH 

it should work fine.

Share what flow did you configure?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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