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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,035)