cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Splitting email subject string

Hi, 

 

I'm a new Flow user and need to understand how to build a Flow to split/manipulate an email subject line which then populates a Sharepoint list. I have the "When new email arrives" and "Create item" connectors sorted, just need to understand how to split up an email subject line.

 

The standard subject line looks like:

 

xxxxxx xxxxxxxxxxx XXX0000/XXXXXXXXX/00000 XXXXXXXXX

Where x = letters and 0= numbers

 

The numbers in red are the ones that I want. They can vary between just 1 digit to up to 5 (or theoretically more)

 

Assuming I will need to use split but not sure how. In current attempts the flow runs but the no splitting results in the sharepoint list.

 

Any help appreciated!

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

 

Combine different string and collection operations to extract the value from the email subject

 

 

Capture

 

function in set variable

 

first(skip(split(replace(triggerBody()?['Subject'],' ','/'),'/'),4))
 
function replaces the space in the subject with '/'.
splits the subject into array elements delimited by '/'.
deletes the first 4 elements from the array.
then takes the first element in the new array which is the number you are looking for.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

 

Combine different string and collection operations to extract the value from the email subject

 

 

Capture

 

function in set variable

 

first(skip(split(replace(triggerBody()?['Subject'],' ','/'),'/'),4))
 
function replaces the space in the subject with '/'.
splits the subject into array elements delimited by '/'.
deletes the first 4 elements from the array.
then takes the first element in the new array which is the number you are looking for.
Anonymous
Not applicable

Thanks so much - worked perfectly!! Smiley Very Happy

Really helpful thank you! I'll now be looking into extracting multiple words from an Emails Subject Field using this method 🙂 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,013)