Loop over entrys and compare them

Describe the problem/error/question

i wanna build an tool to pull my rss feeds and compare the titles with an database table that contains all our programs, but it seems like i have problems understanding how to compare these datas as i dont get how to get two different “data” sets together without usuing merge (but even this seems to not work)

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

[
{
"title": 
"Angriffe auf Citrix-Sicherheitslücke beobachtet",
"link": 
"https://www.heise.de/news/Angriffe-auf-Citrix-Sicherheitsluecke-beobachtet-10100614.html?wt_mc=rss.red.security.alert-news.rdf.beitrag.beitrag",
"pubDate": 
"Fri, 22 Nov 2024 13:50:00 +0100",
"content:encoded": 
"<p><a href="https://www.heise.de/news/Angriffe-auf-Citrix-Sicherheitsluecke-beobachtet-10100614.html?wt_mc=rss.red.security.alert-news.rdf.beitrag.beitrag"><img src="https://www.heise.de/scale/geometry/450/q80//imgs/18/4/7/3/4/3/0/9/2024-09-30-Bing_Image_Creator-Server_Angriffe-1-fdc929fafeb2e7f6.jpeg" class="webfeedsFeaturedVisual" alt="" /></a></p><p>In der vergangenen Woche hat Citrix Sicherheitslücken im Session Recording geschlossen. Nun haben IT-Forscher Angriffe darauf beobachtet.</p>",
"content:encodedSnippet": 
"In der vergangenen Woche hat Citrix Sicherheitslücken im Session Recording geschlossen. Nun haben IT-Forscher Angriffe darauf beobachtet.",
"content": 
"In der vergangenen Woche hat Citrix Sicherheitslücken im Session Recording geschlossen. Nun haben IT-Forscher Angriffe darauf beobachtet.",
"contentSnippet": 
"In der vergangenen Woche hat Citrix Sicherheitslücken im Session Recording geschlossen. Nun haben IT-Forscher Angriffe darauf beobachtet.",
"guid": 
"http://heise.de/-10100614",
"isoDate": 
"2024-11-22T12:50:00.000Z"
}
]
[
{
"id": 
0,
"program": 
"Test",
"customer": 
"test"
},
{
"id": 
1,
"program": 
"Test2",
"customer": 
"test"
},
{
"id": 
2,
"program": 
"Paolo",
"customer": 
"test"
}
]

Information on your n8n setup

  • **n8n version: 1.67.1
  • **Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • **Operating system: debian 12

Welcome to the community @unclesam87 !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


Loop is not working because you have Filter in there. The items coming out of “loop” output should have corresponding items returning back to the Loop’s input. The Filter blocks some creating a mismatch.

To compare datasets, you could also use Compare Datasets node which is a more versrtile tool for the job of comparison than Merge.

hello @unclesam87

that’s how you can do it without the Loop node

hey
@barn4k thanks for u answer: yeah that is what i tought too at first but then recongizing that the title infos i wanna compare will allways be filled by many other different things, so i tought i need an filter to compare the infos between program name and titel and when titel is containing an program name to put it out (the idea is it to scan rss feeds for security warnings about a program list that we are actually using so that the sys admins only get the important infos as an push notification)

@ihortom thanks for ur answer too, i am sorry but i dont get what u mean?
and about ur tip for sharing → did i forget to remove some informations? thanks for any help!!

You can compare them via the Code node

It will check if any title of the RSS entries contains a program name from the DB entries (both lowercased to avoid case issues) and if no matches happen, it will return the RSS entry

You shouldn’t use Filter nodes in the loop as it is likely to break it. The Loop node expects the same amount of items returned during iteration as is in the iteration cycle. The Filter node implies blocking some items which in turn result in less items returned back to the Loop node. This will surely cause unexpected results.

Here’s an example for clarity. There are 10 items with iterations of 2 items in the batch. The Done node has no items as the Loop stopped prematurely due to usage of the Filter node. The workflow itself did not fail. It’s just the result is not what you might have expected.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.