Hi @ellishar ,
Welcome to Microsoft Q&A forum and thanks for reaching out here.
You can use the @intersection() function in Azure Data Factory pipeline expression to compare two collections and get the intersect values.
Here is the syntax for the "intersection" function:
@intersection([<collection1>], [<collection2>], ...)
The intersection()
function returns a collection that has only the common items across the specified collections.
For your requirement what you can do is, create a array type pipeline variable and after Script activity 1 and script activity 2, then have a subsequent set variable activity in which you will find the intersection values and store them for further processing.
Below is how the flow looks like:
Below are the outputs of my two script activities which will return the column names of two different tables.
In the set variable activity, I used below expression to find the intersection values of both the collections (script activity outputs)
@intersection(activity('getColNamesFromEmployeeTable').output.resultSets[0].rows,activity('getColNamesFromEmployeeSalaryTable').output.resultSets[0].rows)
Below is the output of the above expression:
{
"name": "varIntersecValues",
"value": [
{
"colName": "EMPLOYEEID"
},
{
"colName": "LASTNAME"
},
{
"colName": "FIRSTNAME"
}
]
}
Hope this helps.
Please don’t forget to Accept Answer
and Yes
for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.