Save matching emails to a spreadsheet
Saves each new Gmail message that matches your search as a row in your spreadsheet, and never saves the same message twice.
Apps it connects
Authenticate each one once and the workflow is ready to run.
What it does
Each integration step this workflow runs, in order, what it is for, and the conditions and loops that decide when it runs.
- 1
GmailNew email triggerWakes the workflow when new mail arrives in Gmail, optionally only from a sender you name on the trigger. - 2
GmailList emailsLists the messages matching your search that do not yet carry the saved label, up to the batch size for one run. For each
messageIf
messageIdis not empty- 3
GmailAdd label to messageApplies the 'Saved to sheet' label to each message as soon as it is picked up, before its row is written. - 4
GmailGet message headersReads the message's headers to record the time it was sent and the address it was sent to. Try
- 5
Google SheetsAppend rowAppends one row per message: sent time, sender, recipient, subject, body excerpt, message id and a link into Gmail.
If a step fails
- 6
GmailRemove label from messageTakes the saved label back off a message whose row could not be written, so it is retried next run.
- 5
- 3
How it works
What happens on each run, in plain English.
Whenever new mail arrives in Gmail, the workflow looks for the messages your search matches, such as everything from a billing address, and writes one row per message into your spreadsheet. Each row records when the message was sent, who sent it, who it went to, the subject, an excerpt of the body, the Gmail message id and a link that opens the message in Gmail.
Nothing is saved twice. Each message is labelled 'Saved to sheet' the moment it is picked up and the search excludes that label, so a message already saved is never fetched again. The label goes on before the row is written on purpose: if the sheet cannot be written to, the label comes off again, the message is retried next run and the run ends in failure so you can see it. Several matching messages landing at once are all saved, and a backlog is worked through a batch at a time.
Before the first run you need a spreadsheet tab with headings in that column order, and a Gmail search that picks out the mail worth saving.
Start from a workflow that already works.
Add "Save matching emails to a spreadsheet" to your workspace, connect its apps, and make it yours. No credit card required.
Free plan available · No credit card required
