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

Community site session details

Session Id :
Power Automate - Building Flows
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!

 

I have the same question (0)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard