How to get the specified email body data from email usin Get IMAP mail messages activity?

I am trying to build process which collects data from email body and inserts them in excel file predefined columns. So far I have created process which collects emails and in Output shows email body data, but I don’t know how to add specified rows from body to excel spreadsheet table.

I would like to know what kind of activity I should use to add email body data excel file which?

At the moment process looks like that:

1 Like

What is the mapping you are trying to achieve.

I can see your table rows contain your data.
Can you break it down so that we can try the extraction of the data accordingly?

So I receive such a standard email (approximately 30 a day):


From this email I need to add specific rows to shared excel file like this:

At the moment I have in output email body message with all tags, but I have no Idea what kind of activity should I use further to collect data from email body and add them to xls file.
I can also share xaml file if needed.

1 Like

I am beginner in uipath and such a robotic process will help me a lot.

Ok so i tried out your example.
First the first image you pasted does not have the same data as the mail format you have pasted above.

Assuming you have the second one to do,
image

here is what i did.

  1. Same Get IMAP Mail Messages
  2. Same Loop forEach listOfMails
  3. To get the Email Date

image
a. headerdate(string) = mail.Headers(“Date”)
b. emailDate(string) = Convert.ToDateTime(headerdate.Substring(headerdate.IndexOf(",")+2,11)).Date.ToString(“dd.MM.yyyy”)

Result:
image

Email Body write line before:


After replace:

Details to get text from HTML can be seen here:

So this may not be your full solution but i wuld need some moe details to understand the exact mail body you have.
Once we get till the above part of replace the write to excel is simple :slight_smile:

Hi Kamazs112,

If the mail format is standard then to extract the information from the “Email Body”, use “Split”.

strListMailBody = strMailBody.Split ({“Company Name:”, “Comment:”}, StringSplitOptions.None)

The result is assigned to a String List and then you get the value (In the first projection).

strCompanyName = strListMailBody (1) .ToString

In this way for each field you want to obtain

Only if the format will not change.

Regards

2 Likes

Hello Nadim.
I created process like you said but I didn’t get results like you provided in screens *Assign Closed *26.10.2018
email body - Copy.xaml (8.2 KB)

In attachment I added xaml file

Hello, Can you send me please your Xaml file, for see this example, because i have a use-case like this.

Thanks

Hi sir , Am using regex and match the particular value in gmail body but i want to know the split method of particular mail please will you send me the example mail spilt method
Thanks in Advance