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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to extract date an...
Power Automate
Unanswered

How to extract date and time from email

(0) ShareShare
ReportReport
Posted on by 18

Hello,

 

very new with flow and automation. 

I want to create a google calendar event using the information in notification email body or subject. 

EFernando_0-1619806470149.png

this is the kind of email i would get. the invitee will be different every time. and the invitee email. also the date and time. 

 

all i want to do is a way to extract the date and time so i can plug it in to the workflow below. End time will always be 30 minutes after start time. i can do that by add minutes. but figuring out start time seems impossible.

EFernando_1-1619806544605.png

 

please, any help is greatly appreciated!!! 

 

-Eranga

 

Categories:
I have the same question (0)
  • jinivthakkar Profile Picture
    4,187 on at

    @EFernando please share output of html to text action 

  • EFernando Profile Picture
    18 on at

    @jinivthakkar see below for both conversions of subject and body. i did them both in separate steps. 

    Let me know if there's a different way to see the output

     

    raw input for subject -

    {
        "host": {
            "connectionReferenceName""shared_conversionservice",
            "operationId""HtmlToText"
        },
        "parameters": {
            "Content""<p>New Event: John Doe - 01:00pm Mon, May 3, 2021 - Tower Crane (CMM) - 30 min</p>"
        }
    }
     

    raw output for subject - 

    {
        "statusCode"200,
        "headers": {
            "Pragma""no-cache",
            "Transfer-Encoding""chunked",
            "Vary""Accept-Encoding",
            "Strict-Transport-Security""max-age=31536000; includeSubDomains",
            "X-Content-Type-Options""nosniff",
            "X-Frame-Options""DENY",
            "Cache-Control""no-store, no-cache",
            "Set-Cookie""ARRAffinity=e6542d98ba549c57708befaa0104ee3a0d8267c5ad730919ce48720c5d020975;Path=/;HttpOnly;Secure;Domain=conversionservice-cus.azconn-cus.p.azurewebsites.net,ARRAffinitySameSite=e6542d98ba549c57708befaa0104ee3a0d8267c5ad730919ce48720c5d020975;Path=/;HttpOnly;SameSite=None;Secure;Domain=conversionservice-cus.azconn-cus.p.azurewebsites.net",
            "Timing-Allow-Origin""*",
            "x-ms-apihub-cached-response""false",
            "Date""Mon, 03 May 2021 15:14:33 GMT",
            "Content-Type""text/html; charset=utf-8",
            "Expires""-1",
            "Content-Length""75"
        },
        "body""New Event: John Doe - 01:00pm Mon, May 3, 2021 - Tower Crane (CMM) - 30 min"
    }
     
     

    raw input for body - 

    {
        "host": {
            "connectionReferenceName""shared_conversionservice",
            "operationId""HtmlToText"
        },
        "parameters": {
            "Content""<p><html lang=\"en\" style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif\"><head style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif\">\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta content=\"text/html; charset=utf-8\"><meta name=\"viewport\" content=\"width=device-width\" style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif\"><style>\r\n<!--\r\na:visited\r\n\t{color:#4d9bd7;\r\n\ttext-decoration:none}\r\na:link\r\n\t{color:#4d9bd7;\r\n\ttext-decoration:none}\r\n@media only screen and (max-width: 600px) {\r\na[class=\"btn\"]\r\n\t{display:block!important;\r\n\tmargin-bottom:10px!important;\r\n\tbackground-image:none!important;\r\n\tmargin-right:0!important}\r\ndiv[class=\"column\"]\r\n\t{width:auto!important;\r\n\tfloat:none!important}\r\ntable.social div[class=\"column\"]\r\n\t{width:auto!important}\r\n\r\n\t}\r\n-->\r\n</style></head><body bgcolor=\"#ffffff\" style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif; height:100%; width:100%!important; background-color:#ffffff\"><div class=\"main-wrapper\" style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif; padding:20px 0; margin:0 auto; max-width:600px\"><table class=\"body-wrap\" style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif; width:80%; margin:20px auto 0; margin:0 auto; padding-bottom:20px; border-bottom:1px dashed #dadada\"><tbody><tr style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif\"><td style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif; text-align:center\"><p style=\"font-family:&quot;Proxima Nova&quot;,&quot;proxima-nova&quot;,Helvetica,Arial sans-serif\"><img alt=\"Calendly\" src=\"http://assets.calendly.com/assets/emails/logo-email-header_legacy-bf5b520caa9ce340db28579b758ee14277...>"
        }
    }
     

    raw output for body - 

    {
        "statusCode"200,
        "headers": {
            "Pragma""no-cache",
            "Transfer-Encoding""chunked",
            "Vary""Accept-Encoding",
            "Strict-Transport-Security""max-age=31536000; includeSubDomains",
            "X-Content-Type-Options""nosniff",
            "X-Frame-Options""DENY",
            "Cache-Control""no-store, no-cache",
            "Set-Cookie""ARRAffinity=e6542d98ba549c57708befaa0104ee3a0d8267c5ad730919ce48720c5d020975;Path=/;HttpOnly;Secure;Domain=conversionservice-cus.azconn-cus.p.azurewebsites.net,ARRAffinitySameSite=e6542d98ba549c57708befaa0104ee3a0d8267c5ad730919ce48720c5d020975;Path=/;HttpOnly;SameSite=None;Secure;Domain=conversionservice-cus.azconn-cus.p.azurewebsites.net",
            "Timing-Allow-Origin""*",
            "x-ms-apihub-cached-response""true",
            "Date""Mon, 03 May 2021 15:14:33 GMT",
            "Content-Type""text/html; charset=utf-8",
            "Expires""-1",
            "Content-Length""5135"
        },
    }
  • EFernando Profile Picture
    18 on at

    @jinivthakkar not sure why my other comment got deleted

     

    Raw input for subject - 

    {
        "host": {
            "connectionReferenceName""shared_conversionservice",
            "operationId""HtmlToText"
        },
        "parameters": {
            "Content""<p>New Event: John Doe - 01:00pm Mon, May 3, 2021 - Tower Crane (CMM) - 30 min</p>"
        }
    }
     
    Raw output for subject - 
    {
        "statusCode"200,
        "headers": {
            "Pragma""no-cache",
            "Transfer-Encoding""chunked",
            "Vary""Accept-Encoding",
            "Strict-Transport-Security""max-age=31536000; includeSubDomains",
            "X-Content-Type-Options""nosniff",
            "X-Frame-Options""DENY",
            "Cache-Control""no-store, no-cache",
            "Set-Cookie""ARRAffinity=e6542d98ba549c57708befaa0104ee3a0d8267c5ad730919ce48720c5d020975;Path=/;HttpOnly;Secure;Domain=conversionservice-cus.azconn-cus.p.azurewebsites.net,ARRAffinitySameSite=e6542d98ba549c57708befaa0104ee3a0d8267c5ad730919ce48720c5d020975;Path=/;HttpOnly;SameSite=None;Secure;Domain=conversionservice-cus.azconn-cus.p.azurewebsites.net",
            "Timing-Allow-Origin""*",
            "x-ms-apihub-cached-response""false",
            "Date""Mon, 03 May 2021 15:14:33 GMT",
            "Content-Type""text/html; charset=utf-8",
            "Expires""-1",
            "Content-Length""75"
        },
        "body""New Event: John Doe - 01:00pm Mon, May 3, 2021 - Tower Crane (CMM) - 30 min"
    }
  • jinivthakkar Profile Picture
    4,187 on at

    @EFernando here is how I did this, Compose step 1 has the raw output you shared

    jinivthakkar_0-1620106190773.png

    jinivthakkar_1-1620106271966.png

     

    Compose 4 - Event start date time

    Compose 5 - Event end date time

    Compose 6 - Subject 

    The same has been passed to create event 

     

    Expressions used are as below

    outputs('Compose')['body'] //Compose 2
    
    split(outputs('Compose_2'),' - ') //Compose 3
    
    formatDateTime(outputs('Compose_3')[1],'yyyy-MM-dd hh:mm tt') //Compose 4
    
    addToTime(outputs('Compose_4'),30,'Minute','yyyy-MM-dd hh:mm tt') //Compose 5
    
    outputs('Compose_3')[0] //Compose 6

     

    Hope this helps.

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • EFernando Profile Picture
    18 on at

    @jinivthakkar thank you very much for taking time to help me. 

    the only step that i can't figure out is Compose 2

    EFernando_0-1620217758989.png

     

    Mine looks like this. and mine is an expression instead of an output. 

    EFernando_1-1620217827865.png

    Please advise. thank you.

     

     

  • jinivthakkar Profile Picture
    4,187 on at

    @EFernando what is the action before Compose, please can you share screenshot with that action ?

  • EFernando Profile Picture
    18 on at

    @jinivthakkar see below. Compose is Html to text 2

    EFernando_0-1620303573876.png

     

  • jinivthakkar Profile Picture
    4,187 on at

    @EFernando Compose 1 should be body from step 1 when an email arrives.

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

  • EFernando Profile Picture
    18 on at

    @jinivthakkar I get this error for compose 2.

    EFernando_2-1620661526333.png

     

     

     

    see below for my updated flow. i fixed compose 1 per your direction.

    EFernando_3-1620661547615.png

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard