cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jspeer1
Helper II
Helper II

HELP - Split Email Subject & Extract Text

Hi All,


I have a working expression that will extract a portion of the Subject of an email which I can then use to write to Excel however I am now dealing with another Email Subject that is funny enough impossible to split.


How it's currently working:

Here's the expression I'm currently using:

first(split(last(split(triggerBody()?['Subject'],'LOW - ')),' - '))

Here's the email subject:
Incident Assigned | LOW - INC0001234567 - Test : More Random Text

Output:
INC0001234567

Thing is I can't have it split at "LOW - " since the emails can come in with "MEDIUM" or "HIGH" instead of "LOW"

I tried doing this expression:
first(split(last(split(triggerBody()?['Subject'],' - ')),' - '))

So it would split what's between the two hyphens "-" and just give me the INC Number

Example Subject:
Incident Assigned | MEDIUM - INC0004421750 - Text: Hello Reader

Regardless all I need is always the INCnumber (INC############) that will always appear between the two hyphens.
 
Sample Flow:
 
1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

How about....

 

trim(split(outputs('Subject'), '-')[1])

trimSplit.png

 

View solution in original post

1 REPLY 1
Paulie78
Super User
Super User

How about....

 

trim(split(outputs('Subject'), '-')[1])

trimSplit.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,822)