Created
February 20, 2023 19:21
-
-
Save rmdes/6a656e0baf7b5c98a5e05787c4d5f536 to your computer and use it in GitHub Desktop.
is it new function block with the old Function node N8N
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const staticData = getWorkflowStaticData('global'); | |
const newRSSIds = items.map(item => item.json["Date"]); | |
const oldRSSIds = staticData.oldRSSIds; | |
if (!oldRSSIds) { | |
staticData.oldRSSIds = newRSSIds; | |
return items; | |
} | |
const actualNewRSSIds = newRSSIds.filter((id) => !oldRSSIds.includes(id)); | |
const actualNewRSS = items.filter((data) => actualNewRSSIds.includes(data.json['Date'])); | |
staticData.oldRSSIds = [...actualNewRSSIds, ...oldRSSIds]; | |
return actualNewRSS; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment