How can I compare two different list?

0
Hello there! I am trying to compare two lists from two different entities. The entities have almost exactly the same attributes, with some missing in one of them. I want to compare just two or three attributes to create a validation, in case an uploaded entity already exists. I was wondering how I could do this?   In my microflow below, I am creating two lists and comparing them with an intersect. Then, I use a contains function to check if the intersected values appear in the existing list.  
asked
1 answers
0

If you need to ensure that the new record is in either entity 1 or entity 2 then you can use a filter function on the lists of entity 1 and entity 2 and filter by expression to compare the fields. In this filter function the list object is the currentObject, this can be used in writing the query. Comparing 2 lists from different entities by intersecting or using contains is not an option.

Use the filter by expression in the loop over the new objects. P.S. in the example I see that you are committing objects in the loop. This is not a good practice and will have a negative effect on performance. It is better to add the objects that need a commit in a new list that you commit outside the loop.

answered