Get Gmail email then forward using gmail node

Describe the issue/error/question

I’m trying to download all emails that comply with a specific search pattern, then forward them (by creating a new email) to another address.
I can get the Gmail node to read the emails, no problem.
After that one, I add another Gmail node to Send email, but I don’t find a way to add the attachments from the original email into the new one.
I can see the binaries, but can’t find an expression to add all of them to the new email.
There could be just one, or two, or three, I never know, but I need to forward all of them.

What is the error message (if any)?

Please share the workflow

Share the output returned by the last node

The output is just 1 item and the error message.
What I can see on the attachment field is this:
image

Information on your n8n setup

  • n8n version: 0.220.0
  • Database you’re using MariaDB:
  • Running n8n with the execution process [own(default)]:
  • Running n8n via [Docker]:

Hi @gabrielpc1190, the “Attachment Field Name” field would expect just the name of the binary property (or if there are multiple attachments, a comma separated list of these names).

$binary would, however, reference the entire dataset. So you probably want to use an expression like {{ Object.keys($binary).join(',') }} instead? The Object.keys method would read the names, .join(‘,’) would return these as a comma separated string.

This seems to work fine for me:

Thank you!
I was away from keyboard because of the hollyweek.
Will do a test later today and post back the results.

I really appreciate having a community to help with little examples.
I’m not a programmer, so I’m definitely grateful for any help like yours.

It works!
Interestingly on the output there is no binary, but when I check the email sent, it has the binaries!
Thank you!

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