Hi guy i needed some help
currently i am stuck to extract information from my email
I would like to extract this table from my email but i currently i am stuck at how to extract the table out ?
I have attached the msg file in the test.zip
Name of School
xx
Name of FP
yy
Type of Query
aa
Date In
Query Question
bb
Query Solution
cc
I have done like this
I have attached an email msg for reference
test.zip (31.8 KB)
Anil_G
(Anil Gorthi)
January 16, 2024, 1:21pm
2
@xxGoRpa
Get the html body from the emil variable…email.BodyAsHTML
Then save the string value to a text file with .html extension
Then use a use application/browser activity and open the created file…then use extract table by indicating the table and get the table into a datatable
Hope this helps
Cheers
vrdabberu
(Varunraj Dabberu)
January 16, 2024, 1:29pm
3
Hi @xxGoRpa
After saving the email messages in .msg format you can follow below process to extract that data to excel.
Make sure to indicate the already opened msg file or pass the Outlook exe application path in Use Application/Browser.
xaml:
Sequence15.xaml (12.4 KB)
Regards
what happen if is not in test.msg ?
it be just in the email ?
does this mean i need to save each email out ??
vrdabberu
(Varunraj Dabberu)
January 16, 2024, 1:34pm
6
Hi @xxGoRpa
You need to save the email out with a name and do the process.
Regards
Anil_G
(Anil Gorthi)
January 16, 2024, 1:35pm
7
@xxGoRpa
You need to save the html body of the email but not the email…once read you can delete the file
Cheers
i see how can i do it ?
any example i can follow ?
any example i can follow ?
vrdabberu
(Varunraj Dabberu)
January 16, 2024, 1:59pm
10
@xxGoRpa
Do you have any specific that you will receive these many number of emails. According to that I will help you with flow.
Regards
xxGoRpa
January 16, 2024, 2:25pm
11
There no specific number but from what i ask
It be using the same table format send to email
Then
The result be like this
vrdabberu
(Varunraj Dabberu)
January 16, 2024, 2:39pm
12
@xxGoRpa
Do you have the count of emails that you receive.
Regards
Anil_G
(Anil Gorthi)
January 16, 2024, 3:34pm
13
@xxGoRpa
Just follow the above 3 steps…
extract html body
Save .html file
Open and Extract table
Are you facing any issue trying this?
Cheers
xxGoRpa
January 17, 2024, 9:21am
14
yes i need to think about it how to do
xxGoRpa
January 18, 2024, 3:59am
15
Anil_G:
extract html body
Save .html file
Open and Extract table
<Assign Name="htmlBody" Value="[item.Body.ToString()]" />
<Assign Name="htmlFilePath" Value="[Path.Combine(Environment.CurrentDirectory, 'email_body.html')]" />
<WriteText File="[htmlFilePath]" Text="[htmlBody]" Overwrite="True" />
i feel like is wrong with the htmlfilepath ?
Anil_G
(Anil Gorthi)
January 18, 2024, 4:56am
16
@xxGoRpa
May I know what is the above one?
Cheers
xxGoRpa
January 18, 2024, 5:07am
17
i manged to do it by
save it to an .mht
then from mht use data extraction to extract the table
now i got is like this
Name of School
xx
Name of FP
yy
Type of Query
aa
Date In
Query Question
bb
Query Solution
cc
is there a way where i wil lcreate my own excel
with the header
then it paste it into A2 as an row ?
Anil_G
(Anil Gorthi)
January 18, 2024, 5:17am
18
@xxGoRpa
You can change the headers from the code if you need…or you can have a template excel with pre populated heqder and then in write range uncheck add headers and write from A2
Cheers
xxGoRpa
January 18, 2024, 6:01am
19
Hi i did that however i got
Name of School
xx
Name of FP
yy
Type of Query
aa
Date In
Query Question
bb
Query Solution
cc
Still