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 / How to get data from a...
Power Automate
Unanswered

How to get data from an email body when body is all text

(0) ShareShare
ReportReport
Posted on by

I have a request to take the email approvals we get from our time off request system and automate it to Outlook and Teams calendars.

 

The body of the emaill comes in like so:

 

Your time off request has been approved.
09/06/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment:
09/07/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment:
09/08/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment:
09/09/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment:

 

Or it may look like this:

 

Your time off request has been approved.
09/06/2022 - 4 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment: AM
09/07/2022 - 4 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment: PM
09/08/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment:
09/09/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: - Comment:

 

There's some other text around these values, but they do not come labeled or tabled.  For this flow, I want the following values from this text:

- the dates at the beginning of each line of text

- the AM or PM value after the Comment: text

- and either the blank in the Comment or the 8 or 4 hours after the date (to set an all day flag or not)

 

I have established my flow to convert the body of the email from HTML to Text, and then set a couple of filter array to get it down to this data:

"09/06/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: -",
  "Comment:",
  "09/07/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: -",
  "Comment:",
  "09/08/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: -",
  "Comment:",
  "09/09/2022 - 8 Hours - St.Louis Vacation Time Off - Position: - Reason: -",
  "Comment:"
 
Now I'm stuck.  I need to get those specific items out of the rows and stick them somewhere (variable, excel table, not sure) so that I can use them in the rest of the flow.  But nothing I'm trying to do to grab those pieces out of the text seems to get me where I want to go.
 
I'm fairly new to PA, but really good at Googling.  I've explored Parse JSON, but that doesn't seem to generate any usable schema.  I can't seem to use Find Text Position inside the filtered array.  I started down the path of an AI, but haven't read enough to see how to make one yet.
 
Any suggestions to get me restarted on the next (or different ways) to get this info out of the email?
 
Thanks!

 

Categories:

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 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard