Save mails on excel after download

There is some way to save and write any mails on a excel file after downloading it??

1 Like

I could not understand your description, please precisely mention that where do you want to write email

Regards,
Pankaj

After I download my mails I want to write then on a excel app, every kind of …

HI,
first you need to read the the Outlook Body mail and then use string manipulation in the below order :

Extract the table content using IndexOf in a string by referring to the starting point
Split the string on the bases on “System.Environment.NewLine” or any other as per the format
Then use the individuals to be assigned to a data table
Push this datatable into Excel.
I upload an example of .xaml.
mailToexcel.xaml (11.8 KB)

Camilla.

But will write everything of the email message right?
Like, It is possible to create variables that store different types of data, from different emails, by pdf to excel and bodymail to excel?

Because in some cases the emails will be payments, and I would like to write just the important things like reference, product, cost, etc.

I can´t find a away to write pdf and images on excel.
If is just one pdf or image … but it´s random the pdf or image that I´m gonna receive.

Can you give me an example of image and pdf please?
For the pdf You can use the Read PDF Text activity and save the output in a variable text, then write it in Excel.
Thank you

Pagamento_Kitchenmakeup.pdf (96.9 KB)

Like this, I wanna take reference, value and entity, but for each one has a diferent location, so I don´t now how to make uipath understand that for each diferent mail that I receive he has to download then, and for mails with attachments to put just the important to me in a excel file.

I think you can try using regular expressions.
For example:
Use Get IMAP Mail Messages Activities, and get unread mails
Use For Each Activity and get Body data ->strMailContent
Use Matches activity to get the all the details
From Value:
Use Matches activity
Properties
Input : strMailContent
Pattern : ((?<=From:).*(?=Company:))
Result: iEnumResult ->IEnumberable
after that use assign activity to get the data
strFrom=iEnumResult (0).ToString()

The same for PDFs.
Camilla.

I can´t understand the meaning of that expressions, I never use then, for example: ((?<=From:).*(?=Company:)) is used in what expression?

For example in your case if you want to extract the Entitade:
Use Matches Activity
Input : strPDFContent
Pattern : ((?<=Entitade).*(?=ReferĂŞncia))
Result: iEnumResult ->IEnumberable
after that use assign activity to get the data
strFrom=iEnumResult (0).ToString()
Let me know :slight_smile:

Do I have to put somthing or is like this? and still gives error on result… I´m new at this sry for spending your time on this !?! ahaha

I think I´m starting to understand,
On input: I create a variable to give a name to the pdf file
In pattern: LOst … ahaha
In result: I convert it to IEnumerable
and then I create a variable strFrom and give it the value of IEnumResult(0).ToString right??

On input: You have to read the pdf and save the variable in a string
Then use In Matches Activity–> the result is a IEnumerable
and then you create a variable strFrom and give it the value of IEnumResult(0).ToString

But I have 3 variables to read ,entidade,referencia,montante, do I have to create a match to each?

Yes exactly

And the pattern it´s equal to each?

No…it changes depending on the strings that contain the word you want to find.

So on entidade: “(?<=entidade).(?=Referência)"
On referencia: "(?<=referencia).
(?=Referência)”
on montante: “(?<=montante).*(?=Referência)” ??? soo lost my gosh, this pattern it´s killing me

On entidade: “(?<=entidade).(?=Referência)"
On referencia: "(?<=Referência).(?=Montante)”
on montante: “(?<=Montante).*(?=)”

How do the program reads a file?