web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse an email for con...
Power Automate
Answered

Parse an email for content in the body

(0) ShareShare
ReportReport
Posted on by 69

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-and-create/td-p/87093

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Using-a-flow-to-extract-email-body-details/m-p/149186

 

Any suggestions would be welcome! 🙂

Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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!

  • Yacob_hard Profile Picture
    69 on at

    Thanks @yashag2255 , that's worked perfectly.

     

    My first time working with variables in flow 🙂 

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Awesome! Glad that it worked.

     

    Thanks,

  • Yacob_hard Profile Picture
    69 on at

    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?

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard