cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
McBlair
Level: Powered On

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
Community Support Team
Community Support Team

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 Team
Community Support Team

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

 

 

 

 

McBlair
Level: Powered On

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

Community Support Team
Community Support Team

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

McBlair
Level: Powered On

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

Perfect, worked like a charm Smiley Happy

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,013)