Hello,
I’m trying to track changes in data with this code
const staticData = getWorkflowStaticData('node');
const newStatusIds = items.map((item) => item.json['status']);
const oldStatusIds = staticData.oldStatusIds;
if (!oldStatusIds) {
staticData.oldStatusIds = newStatusIds;
return items;
}
const actualNewStatusIds = newStatusIds.filter((id) => !oldStatusIds.includes(id));
const actualNewStatuss = items.filter((data) =>
actualNewStatusIds.includes(data.json['status'])
);
staticData.oldStatusIds = [...actualNewStatusIds, ...oldStatusIds];
return actualNewStatuss;
But for some reason this doesnt work, (It does work when ran manually so it must have to do with the fact that it’s not an ID but a string)
Does anyone know how to fix it or what’s wrong with the code? (This code does work with ID’s)