Delete Reference Set Objects in Microflow

Hi, I’m fairly new to Mendix and I’m building out my first individual project for a class. My project involves an entity that contains ‘Employees’ and an entity that contains ‘Groups’. These two entities are connected by a many-to-many reference set with the Employees and Groups referring to each other. I can add and remove groups from an employee using a Reference Set Selector just fine, but I need to be able to remove the groups from an employee using a Microflow. I haven’t been able to figure out how to target those reference set objects using a Delete action. Pulling a list of the employee’s groups and then deleting the objects from that list seems to delete the groups themselves, which is very undesirable. Any help is appreciated!
2 answers

Instead of deleting the group objects, you can just set the association of employee to group(s) as empty in the microflow and then the employee object will no longer be associated to the group(s) that were previously assigned.  

You would just need to use a change object action and the association should look something like $Employee_Group then set that reference attribute to empty in the change action.



In a change Action, you should select the reference set and click Remove.  Then you can place the list of objects you want to remove from the reference set in the Value box.  The screen shot below demonstrates this:

Hope that helps,