Question

Gmail email has multiple attachments but cant select right file to save to drive


Hi All,

Hoping you can help as this has stumped me. I wish to move a email attachment of a csv from an email received which has multiple attachments to my Google Drive. The email usually contains one csv and at least one image.

I have setup a Gmail New Attachment Trigger and then added a Drive action. I have tried two scenarios.

  1. Action to replace existing file - This results in the following Error “'NoneType' object is not subscriptable”
  2. Action to add File - It picks up the Image file attached but not the CSV.

When i look at the “File” field enter specific data to select the CSV file their is no obvious details that refer to the CSV file alone only the PNG file.

 

The email definitely has both files attached as i can forward the email to another email address and download the files manually and access the data.

Does anyone have any ideas on what i can try next?


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

13 replies

Userlevel 7
Badge +14

Hi @PJW99 

Good question.

Try adding a Filter as Step 2 in your Zap: https://zapier.com/apps/filter/help

The condition should be “Attachment Details Mime Type” contains ‘csv’

 

Hi Troy,

Thanks for your help. Unfortunately the Mime Type of text/CSV is not selectable. I can only select the Attachment Details Mime Type for the png file. There is no available reference to the CSV in the format of “Attachment Details Mime Type text/csv”. It is selectable elsewhere as per the screenshot below but this results in the text “image/png,image/jpeg,image/jpeg,text/csv” being inserted into the final file.

Is there a way to filter the details Mime Type other than selecting it from the drop down?

Just to reiterate that the CSV file is definitely in the email.

 

Thanks

 

Pete

 

Userlevel 7
Badge +14

@PJW99 

In your Filter step, try these conditions

“Attachment Details Mime Type” contains ‘csv’

 

Then turn the Zap ON and test, and check your Zap Runs: https://zapier.com/app/history/

If configured correctly only files with a Mime Type that has ‘csv’ will pass the Filter step.

Thanks for your patience,

I think I'm still missing something. I have applied the filter but the only “Attachment Details Mime Type” selectable contains the PNG and it wont let me enter freeform text. So the query says it wouldn't proceed past the filter point.

At this stage I'm not a paying user so cant turn on the Zap history on a 3 step Zap.

 

 

 

Userlevel 7
Badge +14

@PJW99 

The left side argument in the Filter condition is dynamic for every Zap Run.

Turn the Zap ON, test, then check your Zap Runs: https://zapier.com/app/history/

Help article for changing your trigger test data: https://zapier.com/help/create/basics/change-the-test-data-in-your-zap-trigger

Hi Troy,

I have tried multiple examples of the email as it is sent daily to me. All show the attachment in the email data as below but the CSV is not selectable within attachment details mime type only the PNG file.

 

Userlevel 7
Badge +14

@PJW99 

You’re gonna have to trust me.

The left side argument in the Filter condition is dynamic for every Zap Run and is based on your current Zap trigger example.

Turn the Zap ON, test, then check your Zap Runs: https://zapier.com/app/history/

 

Thanks Troy,

Understand its dynamic but Zapier in this case is not recognising all the attachments for every email i have been sent from this particular source. Will go back to source and ask for the email to be sent as text only with attachment and see if this solves the issue, as i suspect it will and will note the outcome here.

BTW, i have the exact same Zap working for another source email so think this is likely something to do with the way the email is coded and in turn Zapier not picking up all the attchments in the dynamic selections.

 

Userlevel 7
Badge +14

@PJW99 

When the Zap triggers with Gmail New Attachment as the trigger event, then for each attachment on an email the Zap will run.

The Filter condition will evaluate the Mime Type and only pass when the Mime Type contains csv.

 

@Troy Tessalone 

Yes, understood. The problem i have is that the dynamic filter condition of text/csv is not available, despite the file being attached to the email and trying multiple versions of the email. It is always a png file in this case. So if Zapier isnt able to pick the attachment up, i will need to either change the way the email is being sent to me or engage Zapier in solving the issue which i appreciate is unlikely.

 

 

Userlevel 7
Badge +14

@PJW99

Zap triggers only pull thru up to 3 of the most recent examples.

In a previous screenshot it shows this:

That means there are 4 attachments on the email, with the CSV file being the 4th attachment, which is likely why you are not able to detect it as part of the example trigger test data.

 

Have you actually tried testing with the Zap turned ON and then check your Zap Runs to see how those processed?

Userlevel 3
Badge +4

Hey @PJW99! I just wanted to check in and see if you were able to get your zap working correctly? 🤔 It seems like you and Troy were pretty close on figuring out a solution using the current setup from your email source instead of having to have information sent to you differently, which seems like it would be the most ideal! To build off of what Troy mentioned above, if the zap trigger only pulls up the 3 most recent examples, that could explain why your attachment might have been missing when you went to set it up as test data. Were you able to turn the zap on to test it?😊

Hi @TamRazzleDazzle 

Unfortunately i couldnt. It works when it is sent from another email provider but not from the original email address. Seems to have been an outlier case. I dont have a premium account so maybe it would work with that.