Read Excel body and write to excel in a particular column

Hi All,

I want to filter the email body from Outlook and paste it in the client’s master excel in a particular column.
The subject will contain a unique reference number which is available in the master excel. We have to paste the email body in a column called “client response” by comparing the subject line and unique reference column in excel.
For eg : Subject : ref123, we have a column in excel with same reference number. Capture the body content and paste it in excel for that particular reference number.

Please help !!! Hope I’m clear in explaining the scenario.

1 Like

Hey @devanand.1292

  1. Read range activity reads the excel data into a table

  2. Use For-Each Row to iterate rows

2a. Assign str_Subject = currentRow("UniqueRef").ToString

2b. Filter email and fetch email body using email activities

2c. Assign currentRow("EmailBody") = emailBody

I have assumed UniqueRef and EmailBody as column names, you can replace it with original.

Outside For-each just use a write range and write the same table back to Excel into the same sheet

Hope this helps.


Hello @devanand.1292

Can you share the screenshot of the master table and email which you want to read?

if you want to get the reference id from the email, you have to use the get outlook mail mesage activity and from that get the subject.

To get only the reference id you can use a regex expression. and get it to variable “RefId”.

Use filter activity to filter the datatbale and you can wtite to the particular row and column

Hi Rahul,

Please find below the attached sample screenshots of the excel along with the mail subject.

Please note that I’m trying to filter using subject “CRT” and paste the body (response) in column “client’s response”.

Thanks in advance

Hi All,

Could you please help me on this. I’m a newbie and would like to apply the solutions provided by you guys!!

Did you try this please ! @devanand.1292

Hi Nithin,

Thanks for your support. I tried filtering using below steps. Correct me if I’m wrong

  • I have assigned SubData = “Action required: Please respond to this email”
    You can find it in the subject line
  • Get Outlook Mail message - Filter Value = “[Subject] = '”+SubData+“'”
    Filtering Top 100 mails and saving op as Filteredmails

But filtering mail is not working. Could you help

Hey @devanand.1292

You are not getting the right results for the filter or is there any error ?


Filter is working now and the above issue is resolved as well… Thanks for the support!!

1 Like

Perfect cool :slightly_smiling_face::+1: