I need to get the items that is exists in Function3 node and not exists in node ERPNext5
using Function Node Function1 hero the 2 items in Function3 not exists in Erpnext5 but the output is 4 item not 2 ,its suppose the output is two this code in Function1 node
const newItems = [];
var Okadd=true;
for (item of $items("Function3")) {
Okadd=true;
for (item_2 of $items("ERPNext5")) {
if(item.json.name==item_2.json.name){
Okadd=false;
break;}
else continue;
}
if(Okadd)
newItems.push({
id:item.json.id
});
}
return newItems;