Filter mails with a specific attachment

Hey at all,
i would like to save attachments from a mail that all have the same attachment Name. So i tried this with an if Action but i don’t know how to define this.

Thanks a lot

Hey @tobschroer,

if the attachments have the same name they’ll be overwritten when downloaded! I’m sure you don’t want that?

Hello @tobschroer,

Below link can assist you.



i delete the attachment directly after downloading, so it should be no Problem.
The PDFs all have the same Name: “LP” . So do you have a Syntax for me how to downloading PDFs only with this PDF Name?

Thanks a lot

What i mean to say is if you use the ‘save attachment’ activity, it’ll save all the attachments for you, but the attachments with the same name will be overwritten!

Could you please try using Save Attachments and try to see what it is doing?
I personally think if the attachments have the same name if will overwrite it!

yes you are right. When i have more mails with the same attachment Name only the first one is downlaoded.

But just to get into the topic. Do you know how to use the filter to only get the pdfs with one specific Name?

Thanks a lot

Try writing the name of the file with extension in double quotes and see if it works?

1 Like

Yes it worked, thanks.

You’re welcome buddy :wink:

Last question @Rishabh_Lakhera :sweat_smile:
Do you have any idea to save attachments with the same Name, so that they will be not overwritten?

Not as of now!
I’m still trying to figure out how it can be done

okay, i’m trying it as well.

You will need to use copy file or move file. filename is the for each. Do an assign to rename file filenamenew = Variable+" “+Variable+” - “+System.IO.Path.GetFileNameWithoutExtension(filename).ToString + " (”+in_EmailDate.ToString(“yyyyMMdd.hhmmss”)+")"+System.IO.Path.GetExtension(filename).ToString then use Move File or Copy File is the same as renaming with something like this Path.Combine(in_DirTemp, filenameNew) I used a temp folder then moved/renamed each file in the for each.