Size: a a a

2021 October 20

DM

Diego Müller in Uipath RPA
Hey guys.
I am having difficulty in this activity. I need to save the files coming from the e-mail, and then save the names of the files I saved in the database, when saving the name of the files in the database it is saving everything, including the .png and not just the names of the .pdf I saved . Any idea how to make this filter?
источник

DM

Diego Müller in Uipath RPA
источник

DM

Diego Müller in Uipath RPA
источник

A

Aditya in Uipath RPA
источник

A

Aditya in Uipath RPA
try this
источник

DM

Diego Müller in Uipath RPA
Thanks @ADITYA_35 , but my difficulty is not saving the .PDF attachments, but in this activity assign where I save the file name to later save in the database, the names of all attachments are being saved, not just the .PDFs
источник

AM

Ashish Mangal 956034... in Uipath RPA
This is because you are just checking whether the email has a pdf attachment or not and not filtering the attachments while saving
источник

AM

Ashish Mangal 956034... in Uipath RPA
If you want to save only .pdf attachments then in Save Aatachments activity put a filter as ".pdf"
источник

DM

Diego Müller in Uipath RPA
thank you @Ashish_Mangal .

My save activity is working correctly, I'm looking for is how to filter when saving the file name.
I'm validating if the email has PDF = ok
Save the PDFs using the filter ".*(.pdf|.PDF|.Pdf)" = ok
I open a While that will repeat itself as long as the count that is incremented at the end of the while is less than the amount of files downloaded = ok
I capture the names of the downloaded files to attach to the database for the next stream activities = not ok
источник

AM

Ashish Mangal 956034... in Uipath RPA
You are trying to fetch attachment from email rather than from the directory where you are saving them
источник

AM

Ashish Mangal 956034... in Uipath RPA
Suggest you to use directory.Getfiles for while loop
источник

AM

Ashish Mangal 956034... in Uipath RPA
Because in email you might have attachments like at index
0 - attachment one as .xlsx
1 - attachment two as .pdf
источник

AM

Ashish Mangal 956034... in Uipath RPA
If you pick attachment from email using counter in sequence then it doesn't mke any sense saving them in directory at first place
источник

AM

Ashish Mangal 956034... in Uipath RPA
Or loop through each attachment and check it's name
источник

AM

Ashish Mangal 956034... in Uipath RPA
Then if it is .pdf save it
источник

AM

Ashish Mangal 956034... in Uipath RPA
I hope its clear to you what I am trying to convey here
источник

AM

Ashish Mangal 956034... in Uipath RPA
Use strFileList = Directory.GetFiles(path of folder where pdfs are saves)

Then
For each file in strFileList
   Path.GetFileName(file) will give you pdf file name
источник

AM

Ashish Mangal 956034... in Uipath RPA
Clear the pdf folder before processing another email
источник

TJ

The Jaat in Uipath RPA
Let's connect private ly
источник
2021 October 21

DM

Diego Müller in Uipath RPA
Sharing the solution, I put another IF inside the While
источник