Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Delimit text extracted from body of an email

Good Day my friends,

I am testing the water with microsoft flows and I was able to extract text from my email, however I would like to delimit the text to be more acurate, I mean get the information per line without capturing information from other lines.


Example, I have the following lines of text in my email, I want to get the information per line, I did it using this structure "

substring(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),'VesselName'), 10),10) now the vessel name could be more longer or even more short, so in this case if the name is longer I want to get the complete name and if the name is short I want to get the name exactly as it is whitout adding information from the next line "Voyage            ISL8022" so if there a way to restrict this?


VesselName    AS Fiorella (AFI)

Voyage            ISL8022

Scenario          SHIFT

PortName         Port Everglades


Thank you in advance


Community Support
Community Support

Re: Delimit text extracted from body of an email

Hi @walfredfu,


Could you please share more details about your scenes?

Could you please explain more details about your requeirment?

What is the problem when you create the flow to acheive your needs?


Please share more details so we would try to provide a proper workaround for you.


Best regards,


Frequent Visitor

Re: Delimit text extracted from body of an email

Hello Alice,

Thanks for your reply. Here is what I need.

I want to extract the following  highlighted text from the body of my email by using microsoft flow:


VesselName                      AS Fabrizia (AFA)

Voyage                ISL8023

PortName                          Castries, St Lucia

EOSP                    2018-06-15 06:12:00

PilotOnBoard                    2018-06-15 06:42:00


ArrivedB            2018-06-15 07:18:00

ETD                      2018-06-15 13:00:00

NextPort            VISTT [1945] 2018-06-16 23:59

MovesForDischarge        29

MovesInTransit                 133

NumberOfReefers           1





ReportDate                        2018-06-15 08:15:00


However the report is dinamyc and the fields that I am trying to get could be differents, in this case  "VesselName" AS Fabrizia (AFA) contain 17 characteres but there are some other vessels that contain 10 or 20 characteres. Now the problem is that sometimes the if the charactares contained are 10 or less the field si getting information from the next line... It is combining Vessel Name and Voyage.



Part of email:

VesselName         Regula             

Voyage   CAR8023

What I need is: Regula


This is what I getting - Value extracted from my email: (Is pulling information from the next line " Voyage"

Regula (REG)CAR


This is the structure that i am using to the the information per each line.

substring(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),'VesselName'), 10),17)

Helpful resources


August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!


Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (4,153)