Skip to main content

So the zap seams pretty simple

I’m using new Attachment in gmail trigger and I want to upload the attachments to Google Drive.

each attachment could be a different file type so I’m leaving the “File Extension” parameter blank. (screenshot attached)

 

I’m expecting the filename to be “2024.12.06 - scan.jpg” and I’m getting ““2024.12.06 - scan.jpg.jpg”

Otherwise everything else is working fine.

 

I have created similar zaps before using the older versions of the Google Drive app and this has never happened before.

 

Any ideas?

 

@Marika Shmotolocha 

Check your configuration it’s likely that the zap is adding the extension and you need to change a setting.

Most likely there will be a setting in the File Extension at the bottom. I believe if this is blank your files won’t get renamed. 

If it is blank reconnect your google drive in case it is misaligned.

 

 


it is blank (see attached screenshot.  That’s why I don’t understand why it’s adding it again.


 

This was wrong. See my next reply


@Marika Shmotolocha 

I have just looked at it and any value I use from the gmail attachment ends up with a double extension. My idea about dates is invalid. 

What I found was I needed to strip the extension from the filename and then it would upload correctly.

I used a python code block to remove the last 4 characters and the upload worked

 

 

I hope that helps.

 


Hi ​@Marika Shmotolocha 
 

Instead of using a Code step which counts as 1 Task, you can use a Formatter step that counts as 0 Tasks.

Zap action: Formatter > Text > Extract Pattern

^(.*?)(?:\.?^.]+)?$

 

Issue with the File name having double file extensions is because the file name include the extension already. (e.g. .jpg)

So even when you leave the File Extension field, GDrive is determining the file extension and including it as part of the file name you see.

Thus it becomes ofile.jpg] + “.jpg” = file.jpg.jpg

 


Thanks for marking the best answer here ​@Marika Shmotolocha! 🙏 I’m so pleased Troy’s suggestion was able to help get things solved. Big shoutouts to both ​@Troy Tessalone and ​@Badger for helping out here—love to see it! 🧡


Reply