List operations - explanation

3
I want to compare 2 lists of object X. In a microflow I want to check if the two lists contain the same (ID) items or not. I assume "equals" is the right list operation for this case. Can somebody explain the different functions of the list operations? Union Intersect Substract Contains Equals
asked
2 answers
16

Union: Returns lists with all (unique) values in both list A and B.
Intersect: Returns list with only those objects that exists in both list A and B.
Substract: Returns lists with objects of list A minus the objects of list A that exist in list B.
Contains: Returns boolean, true when list A has all objects of list B, false when it does not.
Equals: Returns boolean, true when both lists are the same, false when they are not.

Eg. list A = 1,2,3,6
list B = 1,2,4,5
list C = 1,3

Union(A, B) = 1,2,3,4,5,6
Union(A, C) = 1,2,3,6
Intersect(A, B) = 1,2
Intersect(B, C) = 1
Substract(A, B) = 3,6
Substract(C, A) = empty
Contains(A, B) = false
Contains(A, C) = true
Equals(A, B) = false
Equals(A, A) = true

answered
0

Maybe necroposting this thread, but ...

In those examples: are those contents of the lists A,B and C the IDs of the objects or the values in the object.

Because I want to compare 2 lists based on the values in the list (only 1 attribute in it) and as a result only the values in both list (Intersect)

It looks like Intersect is comparing on IDs which wil not give me the result I want.

 

answered