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:
"
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".
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.
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.
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
----------------------------------------------------------
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.
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".
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'),':')}
----------------------------------------------------------
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.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492