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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get Email Body of last...
Power Automate
Answered

Get Email Body of last email

(1) ShareShare
ReportReport
Posted on by 21

Hi,

 

I am looking for a way of getting the body of an email without all the history. So basically, I want to have the body of the email I flagged and not allthe old emails also included in that email.

 

Thanks for your help!


Regards,

Michael

Categories:
  • Verified answer
    Michael_Anton_F Profile Picture
    21 on at

    Found it myself, Message 5 has the solution:
    https://powerusers.microsoft.com/t5/Building-Flows/Extract-only-the-text-from-the-latest-reply-in-an-email-thread/m-p/686732#M92582

    I just tried some other way and was able to get the Latest Email only. Here are the steps

     

    • Every Email will have a separator which can be either a Line or Multi Tab etc., for Example in Outlook / O365 You will have a line which in HTML refer to this 

     

    <div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in">​

     

    • Here is what I did, Step 1
       

    Michael_Anton_F_0-1632816095525.jpeg

     

     

    • Initialize Variables which we call the Delimiter, Body of the Message and Latest ResponseMichael_Anton_F_1-1632816096154.jpeg

       

       

      Michael_Anton_F_2-1632816095706.jpeg

       

       

      Michael_Anton_F_3-1632816095707.jpeg

       

       

    • Finally we call the split function with [0] which gives us the First Email as below. I use this 

     

    split(variables('EmailBody'),variables('Delimiter'))[0]​

     

    Michael_Anton_F_4-1632816095717.jpeg

     

     



  • HagerMohamed Profile Picture
    2 on at

    I have an issue with this function: 

    split(variables('EmailBody'),variables('Delimiter'))[0]​

    Give me an alarm that it is not valid function, what shall I do?

    And after all, how I can post the Mail which I split into teams chat?

    HagerMohamed_0-1669202985184.png

     

  • Flejoyeux Profile Picture
    69 on at

    you can replace it by first(split(variables('EmailBody'),variables('Delimiter')))

     

    but the delimiter doesn't seems to work with my emails

  • newbie7 Profile Picture
    39 on at
    @Michael_Anton_F could you repost the pictures? the image has failed 
     
    thanks

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 298 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard