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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Processing a string th...
Power Automate
Unanswered

Processing a string that has multiple dates in a long format

(0) ShareShare
ReportReport
Posted on by 251

Hi all,

 

I have a set of flows that looks for things in email and then writes them to tables in excel, with the end result being a summary list for "Today" of things that are happening (this is for utility work and we nee to know when to expect outages)

 

Usually these notification emails are for a single date, so with the help of the community i wrote an expression that uses split to pull the text i want out: 

 

trim(split(split(body('Convert'),'When:')[1],'What')[0])
 
This works perfect for single date/time strings - but occasionally i'll get emails that are multiple date ranges (and not standardized in a m/d/y type of format) 
 
For instance - here is one with multiple date/times i received today: 

Beginning 6 a.m. on Monday, May 4, and lasting through 4:30 p.m. on Friday, May 22

 

What i am wondering is - could i build another expression to evaluate if there is multiple instances of , say, the month (typed out) and deal with them accordingly? likely with a start date and an end date column.

 

the only thing that comes to mind would be having an array with all of the months in it and then looking in the string for any of the results? i'm not really sure how i would specifically accomplish that and hope that there is a simpler way?

 

Thanks for your time,

 

Jared

Categories:
I have the same question (0)
  • Verified answer
    ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @Seuadr 

    Since the emails do not follow a standard format, I think you're fighting a losing battle when you try to account for all variations.

    My best suggestion is to parse/process the ones you can.  If the email does not conform to what you have accounted for in your expression, write the full text of the email off somewhere else, like a SharePoint list.  Set an alert on the list so that you know that a new entry has been created.  Include in your list additional columns that contain the data needed for Excel.  Populate the data manually and then have a Flow that writes to Excel.  This way, hopefully, you'll automate most of the process and only need to put "hands-on" a small percentage of the emails and you'll be notified what an email arrives that needs your attention.

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard