Combine: Combine two lists into another list
The Combine function creates a list either from the common elements or from the different elements in two source lists.
From two source lists List1 and List2, a third target list that contains a subset of the two sources can be easily created.
If the new list already exists, it is replaced by the result of Combine.
The target list is populated either with the common elements in both source lists, or with the elements found in one list but not the other.
The list element comparison is performed on a single list element parameter. Its name is assigned to the EQUALS parameter of Combine. For example, if both source list elements contain a parameter named V1, EQUALS=”V1” is set in Combine so that the value of V1 is used in each element from the source lists to select the ones to copy to the target list.
Any string to ID the name of the first list (required)
Any string to ID the name of the second list (required)
Any string to ID the name of the target list (required)
Name of parameter to use for a source list subset selection (required)
List combination mode (required), select one among:
<ytriaAutomation> <SplitIntoSetVarList ListName="sourceList1" separator=":" var1="v1:v2:v3:v4"/> <SplitIntoSetVarList ListName="sourceList2" separator=":" var1="v1:v5:v6:v2"/> <Combine target="combinedList" source="sourceList1" source2="sourceList2" equals="var1" mode="both"/> <Loop list="combinedList"> <ExecuteListAction/> </Loop> <Combine target="combinedList" source="sourceList1" source2="sourceList2" equals="var1" mode="extra"/> <Loop list="combinedList"> <ExecuteListAction/> </Loop> </ytriaAutomation>
In this example, we create two lists
sourceList2, whose elements are “SetVar var1=…”.
Then we combine them into
First we create a list of common entries, i.e.
combinedList contains elements of
sourceList2 that have values for
var1 found in
Then we re-create
combinedList with the values for
var1 that are found in
sourceList2 but not in