How to download all attachments apart from pdf

Hi team ,

I want to filter the attachments download according to below 2 criterias -

  1. Only pdfs
  2. All other documents apart from pdf

I am using below activity -

image

Can you please let me know what should I enter in the filter to achieve the above 2 criterias?

Regards,
Gokul

@gokul1904
are you want to download pdf only OR All type of pdf but not pdf?

I want to download all the documents apart from pdf from “Save attachments” activity

@gokul1904 ok please wait.

1 Like

@gokul1904 I have a solution buts its work when you want to download specific files and you are also knowing that its coming in email.

for this
please put “.*(.xlsx|.XLSX|.xls|.xls | .docx|.text|.jpg|.png)”

in filter section

Note: Its authentic I am using this in my scenarios as well
emailfilter.xaml (7.7 KB)

1 Like

@gokul1904
I have another option to prevent pdf from downloading, but its in testing phase.

"(.|/)(?!PDF|pdf).*

I have tested this one, its need improvement. and nor suitable

Is there a way to do it instead of the filter criteria?

Regards,
G

@gokul1904
Yes loop over mailmessages veriable and put if condition inside that there is any attachment is equal to pdf

Can you please help me with the if condition?

@gokul1904 give me few minutes I am going to office then i will send you

1 Like

Hi @gokul1904, I hope you are doing well.
For you current problem statement I am attaching you a workflow which might help you to get your solution. Just add your outlook account in getmail activity and add your download path in save attachments activity.
Email_not_pdf.xaml (8.5 KB)

Have a good day!

Thanks & Regards,
Shubham Dutta

I tried this one but its not working for my case.
In my case , one email contains pdf as well as other format files. I want to download pdf files in one location and other files at another location.
If I am using yours it is saving all the attachments in one location if it contains a pdf.

Hi @gokul1904 ,
that can be achieved just you have to do for each in the download folder with Directory.GetFiles(File_Path) and moving only pdf files to another folder at the end by only checking file extensions.

1 Like

Hi @gokul1904 ,
this workflow will give you your desired output.
Email_not_pdf.xaml (12.7 KB)
just fill your pdf files and other files download path

Thanks & Regards,
Shubham Dutta

@gokul1904
for single file in email, its easy but for multiple files first get attachments extension then use loop and match with extensions. otherwise we can hardcode only

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.