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 III
Super User III

How about....

 

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

trimSplit.png

 

View solution in original post

1 REPLY 1
Paulie78
Super User III
Super User III

How about....

 

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

trimSplit.png

 

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (38,896)