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 / Building a flow that e...
Power Automate
Answered

Building a flow that extracts date from email

(0) ShareShare
ReportReport
Posted on by 8

Hi,

 

I am new to using power automate but i am trying to create a flow by extracting dates from a justworks email to create an event on the outlook calendar, I also noticed to create an event on I would need a time format which justworks does not provide. Below is an example of the email format:

Policy:

Vacation

Total Days Off:

2.0

Start Date:

07/01/2021

End Date:

07/02/2021

Categories:
I have the same question (0)
  • v-LilyW-msft Profile Picture
    Microsoft Employee on at

    Hi @Ftapiaj39 

    According to your description, you want to get the Start date and End date from email to create an event.

    I created a simple Flow, you can refer to as below:

    The flow is triggered by When a new email arrives, then convert the email body from Html to text.

    vLilyWmsft_0-1627436506371.png

    Expression: last(split(outputs('Html_to_text')?['body'],'Start Date:'))

    vLilyWmsft_1-1627436506375.png

    Get Start Date:

    Expression:first(split(outputs('Compose'),'End Date:'))

    vLilyWmsft_2-1627436506377.png

    Get End Date:

    Expression:last(split(outputs('Html_to_text')?['body'],'End Date:'))

    vLilyWmsft_3-1627436506379.png

    Create event with Start Date and End Date.

    vLilyWmsft_4-1627436506382.png

    When a new email arrive like this

    vLilyWmsft_5-1627436506383.png

    The new event will be created

    vLilyWmsft_6-1627436506385.png

    For more info about function you can refer to:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

    Hope the content above may help you.

    Best Regards

    If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Ftapiaj39 Profile Picture
    8 on at

    Hi,

    Thank you for the help, but for some reason for the end date it is pulling the remaining part of the email instead of just the date.

  • Verified answer
    v-LilyW-msft Profile Picture
    Microsoft Employee on at

    Hi @Ftapiaj39 

    The above method is applicable when there is no content after end date or the content after the end date is fixed.

    If the content behind end date is not fixed, you can try the following screenshots to get the date:

    vLilyWmsft_0-1627882100542.png

    Expression:substring(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),'Start Date:'), 11),12)

    vLilyWmsft_1-1627882142079.png

    Expression:substring(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),'End Date:'), 9),12)

    vLilyWmsft_2-1627882168681.png

    vLilyWmsft_3-1627882212694.png

    Hope the content above may help you.

    Best Regards

    If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

  • Ftapiaj39 Profile Picture
    8 on at

    It Worked! Thank you!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard