Best answer

Google Drive action - how do I filter by PDF attachments?

  • 18 November 2021
  • 5 replies
  • 386 views

I have a zap to store PDF documents attached to GMail mails:

  1. Trigger is new attachment in GMail → works fine.
  2. Filter if Attachment mime type is application/pdf → works fine, only mails with PDF attachments are left.
  3. Upload attachment to GDrive → if a mail has a PDF attachment AND any other attachment, all are saved to GDrive. How can I only save the PDF attachments?
icon

Best answer by Troy Tessalone 19 November 2021, 20:33

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +14

Hi @LiPi 

Make sure you’ve selected the correct variable to map to GDrive and to use in the left side Filter condition.

There are multiple versions: Attachment (singular) vs Attachments (plural)

 

Examples

Thank you. I think I understand, but not sure how to achieve the result I am looking for. If there is a mail with different file types attached, how do I only upload the PDFs?

Right now, the filter lets the whole mail continue if one of the attachments is a PDF but then all attachments are uploaded.

My filter:

 

And my GDrive upload:

 

Userlevel 7
Badge +14

Hi @LiPi 

There is a different Mime Type data point that is singular for just the 1 Attachment, so you’ll need to select that data point in the left side condition of the Filter.

 

[...] you’ll need to select that data point in the left side condition of the Filter.

 

But isn’t that exactly what I am doing? Or are you referring to “Attachment Details Mime Type”?

It looks like the filter is looking at the mail and says “yep, there is a PDF attached”. And then all attachements are stored to GDrive.

Userlevel 7
Badge +14

@LiPi 

Notice the difference in the 2 available Mime Type data points available from the Gmail trigger.

You want to select the SINGULAR version.