HI all, im having to figure out how to extract data from Email Body.
Here is the Extracted data from Email.
and i want to get the following data and SAVE it in excel
Reference No. : KK2252 - John Doe
Ordered By : John Doe
Order item: New Zealand Cat Kibbles
Price : $48.60
Description: New Zealand Cat Kibbles | 9 KG (only $0.70 per cup serving)
SKU : Seconds (Cat)
Subtotal : $48.60
Shipping (Shipping Fee) : $8.49
Total : $57.09 NZD
Shipping Address : JOHN Doe
111 Nameof Street, West Philippines
Philippines, Northland 1010
Thank you in advance:)
You can try the following RegEx pattern for the same:
Reference No\. : (.+)
Price : (.+)
Like this, you can use the required keyword in the similar pattern & extract the desired data.
Hope this helps,
Use the Save Mail Message activity to save the body of the mail in the Notepad file.
Then Use the Read Text file activity to read the above Notepad file and store the data in a String Variable.
After storing the mail body data in a string variable, Use Generate Datatable From Text activity to generate the datatable by using the string data.
After that use write range workbook activity to write the datatable in to the excel.
Check the below image what are the activities to use in workflow.
Hope it helps!!
- Use get outlook mail messages and read the email with the subject you have and want to read.
"[Subject] = The subject mail you want to read"
- Use For each activity and save the mail body in txt document. with the help of below syntax:
- Use Regex expressions to get the required output from the text file.
- Use “Write Range Workbook” to write the extracted values into excel.
Hope it helps!!