Hi Everyone, I’m trying to figure out a graceful way to compare two entities and update one of them if it is missing entries from the other in a microflow. For example, if I have Entity 1 and Entity 2 as shown below, I want to end up with Entity 2 (Updated). It seems like there would be a way to do this with list operations rather than a series of loops, but I haven’t been able to figure out either the right list operation or the right expression. If anyone has a good way of handling this, I would love to hear it. Thank you! P.S. I am very new to Mendix and I’m building my first non-tutorial app. I apologize if I’m missing something that is considered trivial.
A few thoughts:
seems like Entity 1 is the ‘master’, i.e. entries in that should be in Entity 2 after its updated
what are you comparing to see if an object from Entity 1 is in Entity 2? Name, ID, something else?
is ID a development construct? or is it a property of the objects? if its a development construct, I would recommend removing it and comparing Name, assuming Name is unique in Entity 1.
also, what is the default value of status? I ask because after Entity 2 is updated, you show the 2 added objects with different values of status and I’m not sure where those values came from.
To Accomplish this with lists, you can do the following:
Here is what the Find list operation looks like
There are a number of other ways to accomplish this – this is the first one that came to mind.