cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Latest email body extraction from an email thread

Hi Team,

 

So in my current scenario I'm actually pulling the latest email from a email thread and posting it in the Azure DevOps as a comment in a particular Work item.

 

The whole thing was working really great until I found out that the email replied email if short in length actually picks up the last email as well

 

For Ex.

 

Look at the below email thread :

 

Hi xyz,

 

This is a test email.

 

Regards,

ABC

 

From: xyz <xyz@abc.com>

Sent: Friday, November 22, 2019 6:23 AM

To: team <Team@abc.com>

Cc: pqr <pqr@abc.com>

Subject: TFS access

 

Hi team-

 

Please provide access to the project.

 

 

In this particular example while extracting the body I get the full email thread even the previous email as well, At first I decided to use split function like this "

trim(split(outputs('email'),'From:')[0])"
and it was working fine but it failed when it encountered an email thread as below :
 

Hi Team,

 

Here is an attachment work

 

Thanks,

Pqr

 

On Thu, Nov 21, 2019, 15:26 xyz <xyz@abc.com> wrote:

User Story #123456 (Work on something) updated by xyz

  • Comment:
    Comment Test

 Can some one help me on this please? so that I can extract the latest body only as I don't require the previous ones at all.

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Latest email body extraction from an email thread

Hi @SaifAli ,

 

Could you please take a try with the "Body Preview" dynamic content from the trigger as screenshot below:

1.png 

 

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper II
Helper II

Re: Latest email body extraction from an email thread

hi @v-alzhan-msft ,

 

Actually I'm using "Body Preview" only but still getting the whole previous email thread as well.

 

Flow.PNG

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (9,186)