How to Extract particular string from a Email body?

venkatvaradaraj

New Member
Hi Folks,

I have an requirement of extracting the particular text value from the email body.

My Email body will looks like mentioned below:

"Added Values:
App Group Membership: Vendor_Extuser_Group^PROMO_DEALS_ALL^AWF_ALL^JBP_ALL^HBC_ALL^NOA_ALL^QIM_ALL^FSP_ALL
Primary Number: 2600112
MemberOf BU Number(s): 1234567^1040177^1040686^1401777"

I have to get the value of "Primary Number" separately.

I am new to blueprism. So, Kindly help me with doing this.!

Thanks in advance!!!
 

Antimony

New Member
Use an expression like this is a calculation stage:

Mid([Email Body], InStr([Email Body]+16, "Primary Number: "), 7)

That's not precisely what you'd put in, but essentially you're telling Blue Prism to take the 7 characters from the email body after the phrase "Primary number: ". Is your email body and primary number length always consistent?
 

faraz13

New Member
Use Mid (string, startpoint, maxcharacters)
If there is a possibility for primary number value count different from 7, then its better to get the character position of MemberOf BU Number(s) and set it as maxcharacter limit.
 

jpcrepeau

Member
with InString, find the location of Primary Number: , then find the location of MembberOf BU
your mid will start at location of primary number +15 and end at location of MemberOf BU - location of primary number. You might have to trim after, but that should work every time assuming that part remains the same.
 

shhajare

New Member
Use an expression like this is a calculation stage:

Mid([Email Body], InStr([Email Body]+16, "Primary Number: "), 7)

That's not precisely what you'd put in, but essentially you're telling Blue Prism to take the 7 characters from the email body after the phrase "Primary number: ". Is your email body and primary number length always consistent?


we can use this -
Mid([Email body],InStr([Email body],"Primary Number:")+16 ,7)
more precise :)
 
Top