Find if the group has any active members using flow designer

Atheher Fathima
Mega Guru

Hi All,

 

I have a requirement to find out any inactive members(users with profile active = false) and check if this group has any active member before we delete this member. I have a flow created to fetch the details on the inactive members in sys_user_grmember table,however i am unable to fetch if this group has any active members. In case there are no other active members,i would like to create a task. Please assist on how i can find if the group has an active member in flow designer

AtheherFathima_0-1665061476518.png

 

any guidance on this is greatly appreciated

 

1 ACCEPTED SOLUTION

Atheher Fathima
Mega Guru

I was able to use the Script condition to fetch the details  on sys_user_group table

"

return "active=true^typeLIKEe151c58e87b7e81092d696883cbb35a5^RLQUERYsys_user_grmember.group,=0,m2m^ENDRLQUERY";
Active - true , type = assignment group and a relative query with grmember table

View solution in original post

6 REPLIES 6

Community Alums
Not applicable

Hi @Atheher Fathima ,

You have two options for looking up records in Flow designer.

The "Look up record" action gets you exactly one record (or error if no records exist)
The "Look up records" action gets you one or more records based on your query (if any records exist).

And yes, by filtering who the group member is, returns only group membership where that user is a member.

Use lookup records on group member table which will return the count If count is 0 then send approval to CAB approval group else create task 

 

Select the user from "Picker"(Highlighted one)

Use Count In your next IF

SandeepDutta_0-1665063516881.png

 

 

Hi @Community Alums

 

Abel tutor's profile is inactive in sys_user table. I have created a flow that
1. runs on weekly basis
2.that will check if there are any records in sys_user_grmember table with user.Active = false.
3.We found that Abel was part of SD group,now we need to check if SD group has any other active members.
4.if yes, delete the record
5.if no, create a task with the name of the group and assigned to Service Assurance group

I am looking for help on point 3.I have used lookup records action :table sys_user_grmember conditions :User.Active = false. I am able to determine that Abel was part of SD group. However I am unable to find if there are any active members in SD group. I tried to use lookup records for each record again on sys_user_grmember with user is the result of previous lookup(from the data pill) and user.active = true. This is however getting me the list of all active users in the grmember table rather than just from the group Abel is part of

Muhammad Khan
Mega Sage
Mega Sage

This seems to be working for me and might help you fulfill your requirement.

 

MuhammadKhan_0-1665087261151.png

 

Hi Muhammad,

 

I am unable to find records 

AtheherFathima_0-1665409187818.png