Get specific text from Outlook Message

Hello.

Got a problem when tried to get specific text from body of Outlook message.
How to extract string between pre-known text?

Example:
telephone number: +7235237235823
email: human@mail.ch

Need to extract “+7235237235823”, “human@mail.ch” strings.

@ironman Can you elaborate more from the above every time string format will be same or different can you specify some more example string

1 Like

Everty time string format will be same. Robot should extract data from request message and paste to user SAP profile.

If you can not get it piece by piece, then get the whole block and split it.

infolst=info.Split(vbCr)

infolst(0) will contain the first line and you can process further to extract the phone number

1 Like

@ironman Check attached file meets your requirement

Main.xaml (8.2 KB)

1 Like

You can use regular expressions in this case. It will work even if the structure of the mail changes from time to time.

Eg: [\n\r].Object Name:\s([^\n\r]*)

Reference: https://stackoverflow.com/questions/19193251/regex-to-get-the-words-after-matching-string

You can use the regex in the “Matches” activity in uipath

1 Like

Thank you! It works well.