Filter mails with a specific attachment

email
activities

#1

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
Tobi


#2

Hey @tobschroer,

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


#3

Hello @tobschroer,

Below link can assist you.

Cheers,
Pankaj


#4

@Rishabh_Lakhera
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
Tobi


#5

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!


#6

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


#7

@Rishabh_Lakhera
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


#8

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


#9

Yes it worked, thanks.


#10

You’re welcome buddy :wink:


#11

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?
Thanks


#12

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


#13

okay, i’m trying it as well.


#14

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.