Setting association in a microflow based on specific attribute

0
I've imported new data and made it into an ImportEntity. Using a microflow I can turn that entity into another one. I'm struggling to set the association the new entity requires through a microflow. I've tried to understand what this question and this question did but I couldn't get further.   This is the microflow I have to create a new entity. It copies over the name, description, etc. It also has a name for the higher level entity that it's supposed to be associated to. It checks if the  entity already exists by name. If not, it'll copy the attributes. https://modelshare.mendix.com/models/f8457e65-32c6-4058-8205-41c6bac651b4/import-pakket-to-servicepakket   Something like this where Service_Naam defines which service servicepakket is associated with. 
asked
3 answers
1

Jim,

I looked at the microflow you shared and I don't see the Service object you want to associate to.  Your microflow looks fine for creating a servicepakket that doesn't exist.  To associate this new object with the appropriate service object you need to know, or retrieve, the service object you want to associate it to.

I am guessing that your import object has a Service name or some similar identifier for the service.  If so, you need to retrieve the Service object in the same way you retrieved the servicepakket object (the first step in your microflow).  Then, you can test if that Service object exists and, if it does, you can set the association to the Service in your servicepakket object.  You would set it the same way you do for attributes, but you'll select the association as the item to be set and use the $Service object you just retrieved (or created).

Hope that helps,

Mike

P.S.  the inheritance split you are using (green diamond) will work fine.  exclusive splits (gold diamond) are more efficient with processing power, so if your import has a lot of records, you may consider switching to that.  Inside of an exclusive split, the condition you use would be $ServicepakketList = empty , and then proceed accordingly.

answered
1

Chris's comment is in the right direction. Why are you using an inheritance split and not a regular split?

Also why are you querying Servicepakket when the Servicename is on the Service entity?

PS: You can use the model share functionality to post your microflows. This way we can see exactly what is going on in each action.

answered
0

Mike, Andrej: This is the microflow I've created to handle an entire row from the Excel file. Ignore the Log Message activities as I was still fixing various problems that arose while creating this. I used the exclusive split instead of inheritance on your suggestion, Mike.

 

https://modelshare.mendix.com/models/6fac3ec5-c3a0-45bc-8f17-7039b29f53ac/import-excel-to-entities-associations

answered