Skip to main content
Best answer

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

  • November 18, 2021
  • 5 replies
  • 454 views

  • Beginner
  • 4 replies

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?

Best answer by Troy TessaloneBest answer by Troy Tessalone

@LiPi 

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

You want to select the SINGULAR version.

 

View original
Did this topic help you find an answer to your question?
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

Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31488 replies
  • November 18, 2021

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


  • Author
  • Beginner
  • 4 replies
  • November 19, 2021

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:

 


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31488 replies
  • November 19, 2021

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.

 


  • Author
  • Beginner
  • 4 replies
  • November 19, 2021
Troy Tessalone wrote:

[...] 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.


Troy Tessalone
Forum|alt.badge.img+14
  • Zapier Expert
  • 31488 replies
  • Answer
  • November 19, 2021

@LiPi 

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

You want to select the SINGULAR version.