How to Limit the retrieved object in a microflow

2
Hi, I have a MF which retrieves all the object of an entity from a database. The problem is that this list is growing, so now I have to many objects to handle which is causing heap-problems now. So actually I only want to retrieve those entities which are not present in a related table. Example: Customer - CustomerOrder - Order. Now, I only want to retrieve those customers-entities which do not already have a record in the CustomerOrder table. Because I consider those Customer-entities as new. In the remaining part of my worklfow I will add them to this CustomerOrder-table to connect them to an order. I am looking for an XPath solution here, but don't have a clue how to do this. This MF is part of a solution where we have to handle file-import, so we have to set the relations manually (read: by MF's) after these files are imported. Thanks for any help.
asked
2 answers
6

An XPath expression like this is what you're looking for:

//ModuleName.Customer[not(ModuleName.Customer_Order/ModuleName.Order)]

This will retrieve all customers that don't have any orders associated with them.

Note that in a Microflow retrieve action for ModuleName.Customer objects, you'll only need to type the part between the brackets ([ and ]).

answered
0

That is exactly what I was looking for. This also solved my heap-problem I asked a question about in this form.

Thanks Alexander.

answered