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 / extract subject and da...
Power Automate
Answered

extract subject and date from inside email body and make a calendar event

(0) ShareShare
ReportReport
Posted on by 13

Hi,

 

We have a reservation system in Service Now to reserve a seat in our office.

After we reserve a seat we will receive from "test@service-now.com" an email containing this info:

"

Your reservation was confirmed. Here are the details:

  • Reservation number: TEST0049887
  • Subject: Reservation for 27 D
  • Start date and time: 30-05-2024 08:00 Europe/Amsterdam
  • End date and time: 30-05-2024 20:00 Europe/Amsterdam

"

 

My goal is to have an all day event created in my Outlook calendar on 30-05-2024 having the event subject "Reservation for 27 D".

Categories:
I have the same question (0)
  • Verified answer
    abouchaalaBAIT Profile Picture
    932 Moderator on at

    Hello  Here is a step by step actions in order to achieve this : 

    1- Split to get each lign

    2- Split to your values

    @{split(outputs('Compose-_txt'),decodeUriComponent('%0A'))}
    
    @{split(items('Apply_to_each'),':')}

    abouchaalaBAIT_0-1707750000682.png

    @Silvananghel

     

    ----------------------------------------------------------
    If I have answered your question, please mark your post as Solved. 🆗✔️
    If you like my response, please give it a Thumbs Up. 👍
    You can accept more than one post as a solution.

  • Silvananghel Profile Picture
    13 on at

    Hi,

    Thank you for the answer. However I am a novice in Power automate. Before writing here, I tried the Copilot feature to help me with this flow, however with no success. So, it will be helpful if you can provide all the steps. Please note that I do not need to extract the line that include "reservation number", but the line that include reservation "subject".

  • Verified answer
    abouchaalaBAIT Profile Picture
    932 Moderator on at

    Hello @Silvananghel  No problem, here is a detailed step by step solution :

    Assuming the email body of you email is this exact text : 

     

    Your reservation was confirmed. Here are the details:

     

    Reservation number: TEST0049887
    Subject: Reservation for 27 D
    Start date and time: 30-05-2024 08:00 Europe/Amsterdam
    End date and time: 30-05-2024 20:00 Europe/Amsterdam

     


    What we are looking for is the value Reservation for 27 D which is in the 4th lign, second position after ": "

    Use this expression in a Compose action in order to get in 


    split(split(<YourText>,decodeUriComponent('%0A'))[3],': ')[1]


    1-   Split your email body with  decodeUriComponent('%0A') which represent a new lign
    2-   [3] Get the 4th lign 
    3-   Split again with ": "
    4-   [1] get the second position

     

    abouchaalaBAIT_0-1707822252817.png

     

    abouchaalaBAIT_1-1707822261992.png

     


    ----------------------------------------------------------
    If I have answered your question, please mark your post as Solved. ‌‌‌‌
    If you like my response, please give it a Thumbs Up. ‌‌
    You can accept more than one post as a solution.

  • Silvananghel Profile Picture
    13 on at

    Thanks again for your help. Can you describe also how I can extract the date ? I need just the date, not the start hour or the end hour.

  • Verified answer
    abouchaalaBAIT Profile Picture
    932 Moderator on at

    Use this expression for the date

    split(split(split(<YourText>,decodeUriComponent('%0A'))[4],': ')[1],' ')[0]

     

    Expression for the Subject 

    split(split(<YourText>,decodeUriComponent('%0A'))[3],': ')[1]

     

     

    ----------------------------------------------------------

    If I have answered your question, please mark your post as Solved. ‌‌‌‌

    If you like my response, please give it a Thumbs Up. ‌‌

    You can accept more than one post as a solution.

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 535

Last 30 days Overall leaderboard