Looping "Read Rss" on rows of a G-Sheet

My use case

  • Collect automatically the Rss “Feeds” from Rss “Urls” entered by rows in a Google Sheet
  • Merge all Feeds’ titles collected into a single eMail

Problem

The workflow works only for the 1st row of my Google Sheet.

Workflow picture

(happy to share it fully, but I don’t know how to use the ‘</>’ command)

List of Rss Urls to analyse

Only 1st row of the G-Sheet read in “Rss Read”, therefore in “Merge”
Row is "usine-digitale.fr)

Information on your n8n setup

  • n8n version: 1.20.0
  • Database (default: SQLite): none
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ??
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows

Many thanks in advance!

@AyS_0908 , you seem to be reusing the same workflow I gave you a while ago to solve a different task. The solution depends on the data structure you get as an output of your Merge node. Could you share an example of that data?

Hi @ihortom, yes it is exactly the same where finally I had an issue between Steps “Get All Rss” and “Read All Rss”.
=> Currently, my worfklow only looks at row 1 of step “Get All Rss”.

:point_right: STEP 1: “GET ALL RSS” DATA STRUCTURE (in G-Sheet)
(nb: I added here the [ ] in the url for visibility purpose)

:point_right: STEP 4: OUTPUT OF “MERGE NODE”

{
“row_number”:
2,
“EMAIL”:
[email protected]”,
“RSS URL”:
“[ usine-digitale.fr/rss ]”,
“WEBSITE”:
https://www.usine-digitale.fr”,
“VIEWED”:
“”,
“USER TOPICS”:
“”,
“creator”:
“Yoann Bourgin”,
“title”:
“lorem ipsum”,
“link”:
L'Usine Digitale : l'actualité économique, les infos sur les entreprises et tous les secteurs de l'industrie…”,
“pubDate”:
“Tue, 06 Feb 2024 19:45:00 +0100”,
“dc:creator”:
“Yoann Bourgin”,
“content”:
“lorem ipsum”,
“contentSnippet”:
“lorem ipsum”,
“guid”:
L'Usine Digitale : l'actualité économique, les infos sur les entreprises et tous les secteurs de l'industrie…”,
“categories”:
[
{
":
" Réseaux sociaux ",
“$”:
{
“domain”:
Réseaux sociaux : Toutes les actualités sur L'Usine Digitale
}
},
{
"
”:
" X (ex-Twitter) ",
“$”:
{
“domain”:
Twitter : News du réseau social américain - L'Usine Digitale
}
},
{
":
" Logiciels & Applications ",
“$”:
{
“domain”:
Logiciels & Applications : Toutes les actus et innovations - L'Usine Digitale
}
},
{
"
”:
" Applications mobiles ",
“$”:
{
“domain”:
Applications mobiles : actualité, dernières innovations, économie des applis mobiles
}
}
],
“isoDate”:
“2024-02-06T18:45:00.000Z”
},
{
“row_number”:
3, etc on several rows

:point_right: DATA STRUCTURE OF MY G-SHEET COLLECTING THE FEEDS

date feed url feed title feed snippet
Fri, 26 Jan 2024 15:45:00 +0100 [ https://www.usine-digitale.fr/article/… ] title lorem ipsum… snippet lorem ipsum
Fri, 26 Jan 2024 15:15:00 +0100 [ https://www.usine-digitale.fr/article/… ] title lorem ipsum… snippet lorem ipsum…
Fri, 26 Jan 2024 16:12:00 +0100 [ https://www.usine-digitale.fr/article/… ] title lorem ipsum… snippet lorem ipsum…

I tried something with “Loop” (found on the forum), but I probably did not customize it well…

Sorry to bother again on this topic :slight_smile: and thanks !

@AyS_0908 , as I understand, the data in Merge node output is like this (unnecessary for this task data removed for brevity):

[
  {
    "row_number": 2,
    "EMAIL": "[email protected]",
    "RSS URL": "usine-digitale.fr/rss",
    "WEBSITE": "https://www.usine-digitale.fr",
    "creator": "Yoann Bourgin",
    "title": "lorem ipsum"
  },
  {
    "row_number": 3,
    "EMAIL": "[email protected]",
    "RSS URL": "usine-digitale.fr/rss",
    "WEBSITE": "actuia.com/feed",
    "creator": "John Smith",
    "title": "lorem ipsum2"
  },
  {
    "row_number": 4,
    "EMAIL": "[email protected]",
    "RSS URL": "sciencedaily.com/feed",
    "WEBSITE": "actuia.com/feed",
    "creator": "Alan Po",
    "title": "lorem ipsum3"
  }
]

As you want just a list of titles in a single email, you can use the workflow below (starting from your Merge node presented by the Code node).

Here’s the email output

image

It could be presented anyway you like. I have chosen to use HTML unordered list. If you need any special format for your email message, let me know.

Thank you @ihortom.
If I understand well, my workflow as I designed it requires multiple ‘code’ nodes; this is an issue for me, since I don’t code and won’t be able to maintain it.

I wonder if I designed it correctly as a start; my use case* is indeed quite simple, it is surprising that usual n8n nodes can’t handle it.

Input: a sheet with: Users email | Rss Urls (1 to x urls per user)

n8n: Daily and per user email:
→ Search the user’s Rss Urls in a sheet
→ Read the related Feeds,
→ Aggregate all Feeds’ titles, subtitles, and url,
→ Email this aggregation to the given user.

I should probably rework it from scratch… ; for example: I wonder if I could add the ‘eMail’ field from “Get All Rss” in the “Rss Read” node.
This would simplify the whole workflow.

**Example: ** (which does not work…)

Thanks again

@AyS_0908 , I cannot see subtitles in the RSS feeds but otherwise here’s your workflow. No Code involved. The one you see in the workflow is a representation of your spreadsheet. Add your valid email addresses and see the outcome for yourself.

Note that titles in the email body are actually the links to those post.

1 Like

Hi @ihortom, thanks a lot for your support, it is really kind.

  • When I import your workflow in my n8n: it works fine, it’s great.
  • But, when I just replace your “Rss Source” with my “G-Sheet” node: the workflow runs until the Loop is ‘done’, but stops there.

Particularly strange knowing that the G-Sheet code output a json similar to yours… (except that I have X users, therefore X different emails, but I tested with your “Rss Source” node and it worked well).

[
{
“row_number”: 2,
“email”: “mailA@gmail.com”,
“rss url”: “<![CDATA[ - Actualités A la une]]>”,
“website”: “https://www.usine-digitale.fr”,
“status”: “ON”,
“user topics”: “”
},
{
“row_number”: 2,
“email”: “mailB@gmail.com”,
“rss url”: “Maddyness - Le média pour comprendre l'économie de demain”,
“website”: “https://www.maddyness.com”,
“status”: “ON”,
“user topics”: “”
},
etc for other URLs

I spent 4 hours on this… I hardly dare ask you why it doesn’t work…
Thanks!

@AyS_0908 , I cannot explain that. If I’m to test only those 2 items using Google spreadsheet it also works fine. I can only assume that the issue is with the actual data in your spreadsheet. Maybe try to break down the list of items into smaller chunks and locate the culprit that causes this behavior?

1 Like