How to extract specific information from the body of the Email

email
activities

#1

hai ,
I am extracting specific content form the email body but when i reading it showing in HTML format but i need only the specific info and that need to be saved in variable .
can anyone suggest how we can achieve this.


#2

Hi,

  Use any get mail activity like get outlook mail message activity that i have used assign the output from get mail activity to a list<mailmessage> variable. 

Then put an for each function and change the type argument to mail message then from the item returned from the for each activity u can get the body of each mail.
1

Capture


#3

Hi

I want to extract only the data circled in red from email.
But when i am using Mail.Body, the whole data of the mail including the previous mail gets extracted.
@Dominic @sreekanth Any ideas on what could be done in this>??

email

Thanks and Regards.
Shaista


#4

hi @SHAISTA @Raguvarthan @ushu

do you have this workflow?

regards,
venkatesh.


#5

Which one? To extract information from email?


#6

@SHAISTA

yes :slight_smile:


#7

This is the workflow.
You need to configure the IMAP settings.
MailInfo.xaml (7.2 KB)


#8

Hi @SHAISTA,

Refer this post
Capturing data from email

Regards,
Arivu


#9

Do you have any fixed text in that mail body?If yes then you can go with post referred by @arivu96 and use indexof() and substring() to extract required text. @SHAISTA
Thanks,
Sreekanth.k


#10

@arivu96 @sreekanth
Please see in the screenshot i have attached.
The format of the mail will be fixed always.
The reply from the sender will always be approve or disapprove.
But in the mail which i have sent to the vendor, i have already mentioned "Please reply with approve or disapprove"
So if i am extracting the body data and applying if condition to check whether the reply is approve or not, the condition always comes true as UiPath fetches the whole email data including the data of the mail i sent.


#11

Hi @SHAISTA,

After extracting the data split using environment.newline take the first line alone check the condition as approve or disapprove.

Regards,
Arivu


#12

That worked. :slight_smile: