My requirement is that whenever user's Department is changed from one value to other, he should be added to a specific chatter group. Department name and ChatterGroup Name will be same in the system.
ProcessBuilder condition: Everytime user is created/edited and decision is department is not null. Action is as follows:
In the immediate actions, launch the flow as follows: Passing the deparment var and userid var to flow.
Record lookup is for searching chattergroup matching department name.
2nd element is for searching chattergroupmember.
3rd element is for adding user to chattergroup.
Now I need to remove the user from group if his department gets changed. Please help me how can I put a criteria for this?