cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yacob_hard
Level: Powered On

Parse an email for content in the body

Hi there,

 

I'm trying to build a flow where the following happens;

1. Contact Us email is received

2. Flow picks the email address out of the of the body of the received email

3. Flow delivers an email to the email address provided

 

I'm struggling to find an adaptable solution to #2.

 

Here's the format of an email i'd want the flow to read;

 

 First name: *****

 Last name: *****

 E-mail: ******@live.co.uk

 May we contact you about news and offers: yes

 Message: How can I do x while y?

 

The "First name", "Last name", and "E-mail" output are all of variable lengths (determined by the users who input) and so existing solutions i've found on the forums don't seem to help (as far as i can understand);

 

https://powerusers.microsoft.com/t5/Building-Flows/Read-email-content-from-body-of-the-email-extract...

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Using-a-flow-to-extract-email-body-detai...

 

Any suggestions would be welcome! Smiley Happy

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Parse an email for content in the body

Hi @Yacob_hard , 

 

Please refer to the screenshots below and replicate the steps. 

ema1.png

The initialise variable 2 has the value set as an empty line. You can do that by clicking on the value and pressing enter. ema2.png

In the compose action, use this expression 

split(Variables('ww'), variables('test'))

Replace the variable names with the ones you create.

In the set variable value, use the expression:

split(items('Apply_to_each'),':')[1]

This will fetch you the email address. 

 

Important Note: This will work as long as there is no mention of 'E-mail' before the actual E-mail: xyz@acd.com. 

 

Hope this helps. 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: Parse an email for content in the body

Hi @Yacob_hard , 

 

Please refer to the screenshots below and replicate the steps. 

ema1.png

The initialise variable 2 has the value set as an empty line. You can do that by clicking on the value and pressing enter. ema2.png

In the compose action, use this expression 

split(Variables('ww'), variables('test'))

Replace the variable names with the ones you create.

In the set variable value, use the expression:

split(items('Apply_to_each'),':')[1]

This will fetch you the email address. 

 

Important Note: This will work as long as there is no mention of 'E-mail' before the actual E-mail: xyz@acd.com. 

 

Hope this helps. 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Yacob_hard
Level: Powered On

Re: Parse an email for content in the body

Thanks @yashag2255 , that's worked perfectly.

 

My first time working with variables in flow Smiley Happy 

Super User
Super User

Re: Parse an email for content in the body

Awesome! Glad that it worked.

 

Thanks,

Yacob_hard
Level: Powered On

Re: Parse an email for content in the body

Hi @yashag2255,

 

Thanks again for providing the solution.

 

I'm struggling to understand how this works, in particular;

 

1. Why does variable 2 need to be set as blank with 2 lines?

2. How does the compose action pull out an appropriate value?

Super User
Super User

Re: Parse an email for content in the body

Hey!

 

1. The variable has the value (/n/n this is basically a new line)

In the email we have the First Name in first line and Second in Second and Email in third etc. So we split the email body on that new line component and get the desired email value by the other filter. 

2. Refer to the formula used in compose: It gives the array as we required and mapped in the pt. 1. 

 

Hope this helps.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 79 members 3,730 guests
Please welcome our newest community members: