cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Extract text from Body of an email in Flow

Hello

 

I am building a flow that is triggered when an email is received. I want to extract the Line managers email from the body of the email in the flow. Is there an expression that will allow me to do this easily?

 

Below is the body of the email (with X to anonymise the content)

 

Any help is appreciated

Laura

 

http://XXXXXX.learningpool.com/mod/questionnaire/XXXXXXXXX&instance=60
Response from questionnaire "XXXXX Access"
Response : 178
Submitted on: 31/07/2017 13:02:38
Institution :
Department :
User Course : XXX
Group :
Email address :
XXXX@XXXXXX.org
ID : 746
Full name : Laura XXXXX
Username (Email Address) :
lXXXXXX@XXXXXXX.org
Q01_What is your Job Title? : Test
Q02_CA Staff Type : Permanent
Q03->Finance : 0
Q03->Finance Director : 0
Q03->Finance offsetting manager : 0
Q03->Finance Reallocation FY : 0
Q03->Fundraising managers : 1
Q03->Head of Finance : 1
Q03->Head of Funding : 1
Q03->Head of Humanitarian Division : 0
Q03->Head of Programme funding : 0
Q03->Low Risk Grant Approval : 0
Q03->Medium Risk Grant Approval : 0
Q03->High Risk Grant Approval : 0
Q03->Super High Risk Grant Approval : 0
Q03->Super user : 0
Q04_Line manager email :
lXXXXXX@XXXXXX.org

 

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: Extract text from Body of an email in Flow

Hi @Anonymous,

 

If the Email is sent i nHTML format, then you could use the HTML to Text action to convert the HTML Email content into Text, please check the following blog for more details:

Content Conversion service

If you need any further help on this, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Anonymous
Not applicable

Re: Extract text from Body of an email in Flow

Thank you very much the HTML converter is really useful, however I also wanted to extract a specific part of the body of the email and use it in the flow. I want to extract the line-manager email from the body of the email and use it to send an email in flow. Is there a functionality that allows me to extract this from the body of the email?

 

The email address is clearly marked with the prefix; Q04_Line manager email :

Q04_Line manager email : lXXXXXX@XXXXXX.org

 

I can also use the HTML version which has the 'mailito' identifier

Q04_Line manager email : <a href="mailto:lXXXXXX@XXXXXX.org">lXXXXXX@XXXXXX.org</a>

 

I thought there may be potential to use the 'split' expression but cant quite get it to work.

 

Thank you

Laura

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Extract text from Body of an email in Flow

@Anonymous Have you tried also with WDL expressions like getindexof, substring, add, sub and length ?

 

So, you first obtain getindexof the starting prefix ("Q04_Line manager email : <a href="mailto:"), then add the prefix length. You are now pointing to the email address first character

 

Then you need to get the length of the substring you want to extract, a possible strategy is to obtain getindex of the following prefix (I guess the next line would start with Q05).

 

Then you apply substring function.

 

This approach is not very efficient, but I've made it work

 

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Extract text from Body of an email in Flow

@Anonymous Have you tried also with WDL expressions like getindexof, substring, add, sub and length ?

 

So, you first obtain getindexof the starting prefix ('Q04_Line manager email : <a href="mailto:'), then add the prefix length. You are now pointing to the email address first character

 

Then you need to get the length of the substring you want to extract, a possible strategy is to obtain getindex of the following prefix, if there is any.

 

Then you apply substring function.

 

I must confess this approach is not very efficient, but I've made it work in my flows

 

Highlighted
Anonymous
Not applicable

Re: Extract text from Body of an email in Flow

Thanks so much for the reply. Unfortunately, I havent used WDL till now so unsure of the syntax. Would you mind writing out the full expression please? Or is there a useful library I can access for the syntax of WDL?

 

Thanks again

Laura

Highlighted
Advocate II
Advocate II

Re: Extract text from Body of an email in Flow

Hi @Anonymous

 

We do exactly this at Parserr -> https://parserr.com

 

Signup and have a go at setting up. If you have any issues you can contact me directly at courtenay at parserr.com

Highlighted
New Member

Re: Extract text from Body of an email in Flow

I am facing an issue regarding MS Flow. I am sending attachment from notes entity in dynamics 365, file get delivered to the recipient but the attchment in not in valid format, when opened 'error' shownig as file gets corrupted.

 

Help me out of this.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (5,551)