Grabbing a specific item from email body


Part of a process I am automating involves grabbing an email from outlook, and grabbing a specific item out of the email body.

The email body format always stays the same, besides the date and account #'s changing, and the number that I will need will also change. The number I will always need is 415,233.34 or in that “location” in this email. What is the best way to go about getting the number?

Thank you!

Hi @kdrumz

Use get outlook mail messages

for each item in MailMessage and try to split the item based on array

ashwin S

Can you give an example? I am having trouble splitting the item and grabbing the number that I need

Hi @kdrumz,

Can you share your mail body copied text here?
So that i can help you with the solution.

Hi @sharique.khan

I attached the .txt file with the email information. Thanks!
email.txt (572 Bytes)

You can do the following steps to extract the specific item from mail body:-

  • First you can extract the text till your required text using this pattern,
    Pattern = Total $ Amt(.*\n){4}

  • Then you can split the text on the basis of space as delimiter,
    arrayStr = requiredMatch.Split(" ")

  • Now you can get the last item of arrayStr which will be your required field,
    requiredField = arrayStr(arrayStr.Length - 1)

I am attaching the workflow for your reference. (13.8 KB)