Yes, This is possible in js activity.
Step one: Load every list in js context(Which you have mentioned you already achieved)
Step two: comparison Part, Write a js function to compare list based on recipient Id.
//Below example will work, front end dev will be able to help you here to make it better
/****************************************************************************************************************************************************************
Purpose: To compare two objects based on their Ids
* Returns List of common Ids in both list
****************************************************************************************************************************************************************/
var getCommonIdsfromTwoLists = function(objectlistA, objectListB) {
//var commonList = <recipient-collection><recipient/></recipient-collection>;
//use above if you need a collection, willhave to populate from the commonList object using another loop
var commonList = {};
for each(var rowA in objectlistB.recipient){
logInfo("rowA: " + rowA.@id.toString());
for each(var rowB in objectlistA.recipient){
logInfo("rowB: " + rowB.@id.toString());
// use this when you have same structure in ListA and List B to compare
// JSON.stringify(objectlistA) === JSON.stringify(objectlistB)
//use below for all other cases
if( rowA.@id.toString() == rowB.@id.toString()){
commonList[rowA.@id.toString()] = rowA.toString();
continue;
}
}
}
}
return commonList;
}
Step 3: use this function recursively to get common Items from lists or modify this to suit your requirements.
Hope this helps!
Regards,
Amit