Pushover Notification Formatting

I have a location trigger set up in pushcut that sends a webhook to n8n to pull data from a google sheet and send it via notifications in Pushover. There are multiple rows in the sheet data which then creates multiple notifications. This currently works great as I only have a couple of lines in the google sheet. I however do see a time where I have alot of data in this sheet and I am wondering how I can best merge these notifications. I am assuming I need to use a function node to merge the items into one before sending to Pushbullet?

Hi @Colin_Cameron, the Function node (or the Code node if you’re using the latest n8n version) would indeed be one possibility to merge data from multiple items into a single item.

It’s not the only option though. Depending on the data you’re processing and the notifications you’re trying to send, you could also consider the Item Lists node (and its Aggregate Items operation) or simply enabling the Execute Once setting on the Pushover node:

image

If you need help with transforming your data, perhaps you can share an example of the data you currently have and the data you’d like to have instead?

After trying several ways to figure this out I am still stuck. My data looks like this:
[
{
“Description”: “Reel speed sensor 630D”,
“Part Number”: “AH116104”,
“Supplier”: " BRI",
“Location 1”: “Killam”,
“Location 2”: " Camrose"
},
{
“Description”: “Centre knife sections”,
“Part Number”: “H226351”,
“Supplier”: " BRI",
“Location 1”: “Killam”,
“Location 2”: " Camrose "
},
{
“Description”: “Overlap Section Bolts”,
“Part Number”: “H228135”,
“Supplier”: " BRI",
“Location 1”: “Killam”,
“Location 2”: " Camrose "
},
{
“Description”: “Garden Hose”,
“Part Number”: “”,
“Supplier”: " Canadian Tire",
“Location 1”: “Camrose”,
“Location 2”: " Sherwood Park"
},
{
“Description”: “Seed containers “,
“Part Number”: “”,
“Supplier”: " Canadian Tire”,
“Location 1”: “Camrose”,
“Location 2”: " Sherwood Park”
}
]

When I send it to Pushover it creates a notification for each item. I would like to be able to combine it into a single alert. Something that would look like this:

Description|Part Number|Supplier|Location 1|Location 2

For each of the items in a single message on it’s own line.

Hey @Colin_Cameron,

In the past when I have had to merge items to send a message I have used a Code node (although I now use a community node).

Something like the below should get you started, This will output your data like this…
image

Awesome, this works perfect. Thanks a ton for the help.

1 Like

No problem, That was one of the first tricks I found when I first started using n8n almost 2 years ago and it still applies today :slight_smile:

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