Fetch Email and extract some values from Body

Hello,
I need to fetch Unread Emails and need to extract some values.
The Body of Emails will be :

From
Sophie, Joshua
To
Brad, Mac
Sent
23-Jun-2020 16:36:08
ID
345265

Standard Purchase Order 453635467

I need to fetch “453635467” (Standard Purchase Order) and 345265 (ID)

Expected
strPurOrder = 453635467

strID = 345265

Any help or suggestion would be appreciated.

Thanks.

@Gagan_Chaudhari

to get purchase order:

assign
purchaseOrder = System.Text.RegularExpressions.Regex.Match(txt, "Purchase Order[\s]+([\d]+)").Groups(1).Value

to get ID
assign
ID = System.Text.RegularExpressions.Regex.Match(txt, "(?s)ID[\s]+([\d]+)").Groups(1).Value

where txt is the variable containing email Body
image

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.