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 / Help with Extracting D...
Power Automate
Unanswered

Help with Extracting Date from email Body

(0) ShareShare
ReportReport
Posted on by 38

Hi all

 

Firstly, I'll prefix to say I'm an absolutely newbie to PA, but I'm working things out.  One area that I'm stumbling on is how to extract a date from the body of an email.  So an example of the email where the date would be is:

 

Date:

01/Aug/2023 00:00:00 AEST – 01/Aug/2023 06:00:00 AEST

 

It is a HTML based email so the code of the above looks like:

 

Date:<o:p></o:p></span></b></p></td><td style='padding:0cm 5.0pt 0cm 5.0pt'><p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"'>01/Aug/2023 00:00:00 AEST &#8211; 01/Aug/2023 06:00:00 AEST<o:p></o:p>

 

What I need to do is extract the start date/time (and eventually the end as well but lets just focus on the start) and use that to create a calendar item but I just can't make it work. 

 

I would truly appreciate any help with this 🙂

 

 

Categories:
  • v-dezhili-msft Profile Picture
    Microsoft Employee on at

    Hi @Fatal_Lordes ,

     

    Could you please show your email Body usually look like?

    Is your timestamp always behind Date?
    Will there be other "Date" string in your email?
    please try:

    trim(replace(split(split(outputs('Html_to_text')?['body'],'Date:')[1],'–')[0],'AEST',''))

    vdezhilimsft_1-1677048943962.png

     

    vdezhilimsft_0-1677048901891.png

     

    Best Regards,

    Dezhi

     

  • Fatal_Lordes Profile Picture
    38 on at

    Thanks Dezhi.  Do you want the whole email because it is quite long.  And do you want it as it looks in outlook or HTML?  Yes, the date/timestamp is always behind "Date:".  And there are no other "Date:" strings in the email.  The start date/time is between "Date:" and the " - " and the end date/time is between the "-" and the last "AEST".

     

    I've looked at what you have screen dumped.  I get that the "manually trigger a flow" would be my conditions for the email.  I assume Compose 2 is the body of the email?  And HTML to Text is converting the body from HTML to plain text.  And then the next Compose would be your trim comment?  Is that correct?

  • Fatal_Lordes Profile Picture
    38 on at

    Hazzah!  That works!  Thanks, @v-dezhili-msft.  I also tweaked what you put to extract the end date/time using the below formula:

     

    trim(replace(split(split(outputs('Html_to_text')?['body'],'AEST –')[1],'Duration:')[0],'AEST',''))

     

    My flow looks like this:

    Fatal_Lordes_0-1677063042005.png

    Thank you so much.  

     

     

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
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard