Hi All,
I want to retrieve specific keywords from the email body.
following is the email body content and I just want to retrieve ordered product name with quantity… How to achieve that?
2 Likes
Hi @Sameer_Sen
Kindly follow the below steps that could help you resolve this buddy
- use get outlook mail activity or any get mail activity to get the list of mails you want and store it to a variable named out_mailmessages of type mail message collection
- once after getting this use a for each loop and pass the above variable as input and change the type argument as mailmessage
3.here use a assign activity and mention like this buddy
out_body_line_array = Item.Body.Tostring.Split(Environment.Newline.ToArray())
where out_body_line_array is a variable of type array of string - use a for each loop again and change the item as item_1 and pass the above variable as input to the loop and change the type argument as string and inside this for each loop use a if condition like
item_1.contains(“order”) or item_1.contains(“Qty”)
if this condition gets passed it will go to THEN part where you can mention like
out_Product_array = split(item_1.split(“order”)(1).ToString.Trim,“,”).ToString.Trim
this out_product_array will have the array of values like 100 Qty. of Product P1,…
Which you can get with writeline activity or a assign it to a variable you want buddy
Kindly try this and let know whether this works or not buddy
Cheers @Sameer_Sen
try using this regex (?<=\d*)(.*)(?=(,|.))
1 Like
@Palaniyappan
Still showing error…
I’m sharing the workflow please check if I’m making any mistake…
Sequence.xaml (9.6 KB)
2 Likes
yes Sameer the problem with if condition …i chaged
check latest and let me know
1 Like
1 Like
Put and instead of or in if condition and try
1 Like