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

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
Community Support Team
Community Support Team

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.

SaifAli
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,192)