cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Theresa_SPAdmin
Frequent Visitor

Split period-separated strings and concatenate them

Hello I am using Microsoft Flow and I'm trying to autopopulate a column field in SharePoint.

 

I have a CSV file with filename in this date format YYYY.MM.DD.csv. When a user saves the CSV file to the SharePoint library, it should automatically update a text column called 'DataString' with string YYYYMMDD (without the periods) based from the filename. The said column is being used in a calculated column for grouping the documents. How do I do this in Flow?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Split period-separated strings and concatenate them

Hi @Theresa_SPAdmin,

 

I would offer you the workaround to get the string YYYYMMDD from the file name YYYY.MM.DD.csv,please refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose 2 as below:

first(split(outputs('Compose'),'.csv'))

The expression in the Compose 3 as below:

split(outputs('Compose_2'),'.')

The expression in the Compose 4 as below:

concat(first(outputs('Compose_3')),first(skip(outputs('Compose_3'),1)),last(outputs('Compose_3')))

The flow would run successfully as below:

Capture.PNG

 

Or you could combine the expression in only one action and you cold create the flow as below:

Capture.PNG

The expression in the Compose 2 as below:

concat(first(split(first(split(outputs('Compose'),'.csv')),'.')),first(skip(split(first(split(outputs('Compose'),'.csv')),'.'),1)),last(split(first(split(outputs('Compose'),'.csv')),'.')))

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

 

 

 

View solution in original post

2 REPLIES 2
Community Support
Community Support

Re: Split period-separated strings and concatenate them

Hi @Theresa_SPAdmin,

 

I would offer you the workaround to get the string YYYYMMDD from the file name YYYY.MM.DD.csv,please refer to screenshot below to create the flow:

Capture.PNG

 

The expression in the Compose 2 as below:

first(split(outputs('Compose'),'.csv'))

The expression in the Compose 3 as below:

split(outputs('Compose_2'),'.')

The expression in the Compose 4 as below:

concat(first(outputs('Compose_3')),first(skip(outputs('Compose_3'),1)),last(outputs('Compose_3')))

The flow would run successfully as below:

Capture.PNG

 

Or you could combine the expression in only one action and you cold create the flow as below:

Capture.PNG

The expression in the Compose 2 as below:

concat(first(split(first(split(outputs('Compose'),'.csv')),'.')),first(skip(split(first(split(outputs('Compose'),'.csv')),'.'),1)),last(split(first(split(outputs('Compose'),'.csv')),'.')))

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

 

 

 

View solution in original post

Theresa_SPAdmin
Frequent Visitor

Re: Split period-separated strings and concatenate them

Thank you so much, Alice! It works like a charm!

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (6,701)