Skip to main content
Question

Filter and Save Attachments from GMail with Python

  • March 10, 2025
  • 1 reply
  • 17 views

Hello All,

I am attempting to create a zap that saves attachments from Gmail into my G drive. One email can have multiple attachments, and I want to filter out the jpg/jpeg attachments. However, the normal filter by zapier does not allow me to do this, so I tried writing a python script to filter out the jpg’s. I then loop through the attachments returned from the python script to save them individually. The problem is that the python code does not return the original attachment file, only a text document of irrelevant data. My question is how do i configure the python code to return to the actual attachments and not text documents? Please see the screenshots below for reference. 

Thank you for your help


 

Did this topic help you find an answer to your question?

1 reply

Troy Tessalone
Forum|alt.badge.img+14

Hi ​@APS_Masterpiece 

Zap trigger: Gmail - New Attachment

Triggers for each attachment on an email.

Add a Filter with conditions as Zap step 2: https://zapier.com/apps/filter/help

 


Reply