How to read gmail inbox messages and extract the data and delete the mail


I’m using gmail account for extracting the data, from body of the mail.
and I’m getting the count of the unread messages also.
but, The process which i need to do
1)Enter into the mail body and extract the data
2)After extracting, the mail should be deleted

Please explain the process, to achieve this.

1 Like

You can get the email body text by mailmessage.body property and for deleting you can use Move IMAP mail message to a different folder.

1 Like

Thanks i got some what, but still struck for extracting data from body of the mail

In body of the mail, i need to extract table and the process, which i made in uipath is like this below,

i didn’t get the output, please check where i made mistake

@sudhasagar is that table is in the form of attachment or anything. If it is attachment you can download it or if the table is in normal way you can use get text activity and do some manipulations.

No, it is not a attachment.
It is a content of file.

In the then section use get text activity and use write line activity for the output of get text and check once how it gives the output.

@sudhasagar and check with data scrape activity whether it can identify each element or not if it identifies you can get that table like that also

Hi @sudhasagar,
In this case you can get item.Headers("HTMLBody”).ToString to get the html of body email. You can use custom activities available on to convert this html into datatable and then iterate to process. Once processed you can move email with Move Imap activity.
Please try.

1 Like

Data Scarping is working and able to extract as data table variable.

My question, how can i do that process, because for data scarping the mail should be opened and extract in a process manner. but it is different
I’m attaching my work flow, please checkmail.xaml (6.5 KB)

i’m getting like this

Hi @sudhasagar
Correct based on that you can do the manipulations

ashwin S

Hi All,
I can do data scraping any put data into variable. This variable is of Datatable datatype by it remains emply till the end of execution of project.

Please find a custom activity for fetching tabular data from email body

1 Like

Hi, Sourav,

This was a great help, Thanks a lot.

Another thing want to ask you, i want to make a project from Make my trip where I want do Data Scraping for From city and To City, Flight, Timings and Rate of Flight from Make my trip website into MS excel. The problem I am facing is that while doing data scraping there is no next button on make my trip website, the data loads on scroll. How to get all the data for particular search.

Please help on this

1 Like

Hi @Rachana_Chotaliya,
Glad to know it was helpful for your case.
For your next requirement you can try using find children activity along with some hotkey combination for pgdn. If you can share the url i and the other forum members can give it a try?

HOw to Move IMAP Mail Message to the folder “Bin”??? i can get it .