
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: