cancel
Showing results for 
Search instead for 
Did you mean: 

Extract special text

MareenFlemming
Level 4
Hi guys, I have another question for blueprism. I have to extract special text. The trigger to start the process is an E-Mail. In that E-Mail there is a text with a Standard form like this:   "Bitte ablegen. Engagement Name: Testengagement 2018 Robot Version: 2018V1   Mit freundlichen Grüßen," I have to extract and save the underlined text in a data type. The text can have different characters lenght. Thanks in advanced. Mareen
5 REPLIES 5

MelissaSuarez_G
Level 6
With a calculation stage, you can use the InStr formula to find the position of ""Engagement Name:"" and ""Version:"". The underlined text should be between those two, it doesn't matter if it's on a different line.

MareenFlemming
Level 4
Thanks Melissa, I will try it and let you know if it is working for me or not.

MareenFlemming
Level 4
I tried this   InStr([Message Body]; ""Engagement Name:"" AND ""Version:"")   And I'm getting an error: Internal : Failed to evaluate expression 'InStr([Message Body]; ""Engagement Name:"" AND ""Version:"")' - Both operands for 'AND' must be flags.   What does it mean?

MelissaSuarez_G
Level 6
I don't think you can use AND inside the InStr formula. I tried this one and it works: Mid([Message Body], InStr([Message Body], ""Engagement Name:"") + 17, InStr([Message Body], ""Version:"") - InStr([Message Body], ""Engagement Name:"") - 20 ) Please note: The +17 is because ""Engagement Name:"" has 17 characters, so adding those characters to the formula tells BP that you want the text after the end of that string. Similar with the -20 at the end of the formula, the InStr will find ""Version:"" but you don't want to extract that word nor the spaces before it. You might need to adjust the 17 and the -20 depending on the actual format of the email; if you have a HTML email for example, you might get tags like "", but if you adjust the 17 and 20 you should be ok.

MareenFlemming
Level 4
It worked how expected. Thank you so much.