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

Split/Extract names from a delimiter string in Flow

I have files structure like this '123456,Joe Bloggs,5.pdf  I have found an expression I can use to extract the first 6 characters.

 

substring(split(item()?['Name'],',')[0],0,6)

 

I really want to extract each value between the commas (not including the file extension) and insert into a column in the SharePoint library where the file is being stored any ideas or help would be greatly received. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Split/Extract names from a delimiter string in Flow

Hi @McBlair,

 

Please refer to screenshot below to create the flow:

Capture.PNG

 

The expresssion in the Compose as below:

split(first(split(items('Apply_to_each')?['Name'],'.')),',')

 

Best regrads,

Alice

 

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Split/Extract names from a delimiter string in Flow

Hi @McBlair,

 

Could you please share a screenshot of the configuration of your flow?

Could you please share more details about your sharepoint library column?

 

I have made a test on my side on my side to create a sharepoint libaray with three single line of text column to save the value from the file name as below:

Capture.PNG

 

You could refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose as below:

split(first(split(triggerBody()?['{Name}'],'.')),',')

The expression in the Compose 2 as below:

outputs('Compose')[0]

The expression in the Compose 3 as below:

outputs('Compose')[1]

The expression in the Compose 4 as below:

outputs('Compose')[2]

The flow would run successfully as below:

Capture.PNG

 

The values would be updated in the sharepoint library as below:

Capture.PNG

 

Best regards,

Alice

 

 

 

 

Highlighted
Helper II
Helper II

Re: Split/Extract names from a delimiter string in Flow

Hi Alice,

 

Thanks for the detailed reply.  Below is the flow and columns.  The file being saved in the library is an attachment from an email.  Columns are then updated based on the person that has submitted the file.  I have attempted to use the first expression but I get this error...

InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2542': 'The template function 'spilt' is not defined or not valid.'.

 

I followed your expression but Flow appears to have changed it to

 

split(first(spilt(body('Create_file')?['Name'],'.')),',')

 

 

 

1.png3.png2.png

Highlighted
Community Support
Community Support

Re: Split/Extract names from a delimiter string in Flow

Hi @McBlair,

 

Please refer to screenshot below to create the flow:

Capture.PNG

 

The expresssion in the Compose as below:

split(first(split(items('Apply_to_each')?['Name'],'.')),',')

 

Best regrads,

Alice

 

View solution in original post

Highlighted
Helper II
Helper II

Re: Split/Extract names from a delimiter string in Flow

Perfect, worked like a charm Smiley Happy

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,344)