cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tngut_47
New Member

Extract text from subject and create sharepoint file with it

Hello,

 

I'm having a difficulty with my flow. My flow should create a Folder in sharepoint whenever my inbox recieves a message with attachments. I want to name the folder with a specific text or number from the subject of my message. 

 

The problem here is that, the subject name does not have the same length or amount of letters every time. It has one word, that should be accompanied with numbers > something like - Subject: Jane Smith No.: 23456789 (in this case the word is No.: which is always there) and I want to extract the characters after No.:. So I can create my folder with the numbers as it's name. 

 

I've thought about using some Regex function, but there are only ones that need an extend, which I don't want to use. Is there any function similar to Regex match that doesn't need any extensions (like the API?).  

1 ACCEPTED SOLUTION

Accepted Solutions

@Tngut_47 

All good points...

split() creates an array based on a delimiter.  The delimiter can be one or more characters.  If there is one semicolon, there will be two elements in the array.  If there are two semicolons, there will be three elements in the array.

The last() expression returns the last element in an array.

After re-reading your post, I realized should have used No.: as the delimiter:

image.pngimage.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

4 REPLIES 4
ScottShearer
Super User
Super User

@Tngut_47 

You'll want to use a split() expression. 

Note: I should have added a trim() expression around my expression to eliminate leading and trailing spaces.

See my example below and let me know if you have any questions. 

image.png

image.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Tngut_47
New Member

That would work if it has the same pattern, do I undestand that the last function returns the last item of the source? What if it's somewhere in the middle. And what if the subject had two semicolons, how would it recognize which output should it take? 

@Tngut_47 

All good points...

split() creates an array based on a delimiter.  The delimiter can be one or more characters.  If there is one semicolon, there will be two elements in the array.  If there are two semicolons, there will be three elements in the array.

The last() expression returns the last element in an array.

After re-reading your post, I realized should have used No.: as the delimiter:

image.pngimage.png

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Tngut_47
New Member

Thank you for the explantion, will have to explore these functions more. 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (1,685)