I got everything working so far, there are a couple of things I would like to fix about this. First, I would love to add the email of who sent me the email to the end of the document name uploaded to Google Drive. Also with the Google Sheets, I want it to populate one line per email and attachment that is processed. Unfortunately when the information gets to the end, if I only have one google sheets at the end, it doesn’t carry the information for the emails and subject, and if it is before, I cannot add the Google Drive link. The two currently collect all the data, but the email from and to and subject go in one row, then the file name and drive link go in a new row underneath. It is also only gathering the most recent email. I want it to gather the most recent emailS that have not been added to the sheet yet. And if there is no attachment, do not add to sheet.
Hi @piddle99
I have a question related to your use case:
how do you want to handle the case when you have an email with multiple attachments? What to you want to add in that case to Google Sheets?
Here’s a modification to your workflow:
Notes:
I use the limit node just to limit to 1 attachment
To add the email to the file name I used an expression like: {{ $json.fileName.split(".")[0] + "-" + $('Gmail Trigger').item.json.from.value[0].address + "." + $json.fileName.split(".")[1]}}. This is a bit of javascript and work well only if there’s only one full stop (.) in the original name of the file. You need to modify the javascript a bit if more than one full stop is expected.
I then added a single Google Sheets node, but this might change depending how you want to handle the case with multiple attachments