cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-micsh-msft
Community Support
Community Support

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.
Anonymous
Not applicable

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

@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

 

@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

 

Anonymous
Not applicable

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

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

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,864)