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

Flow failing when converting "dd/MM/yyyy" to "yyyy/MM/dd"

Hi

 

For some reason, I cannot get flow to recognize "dd/MM/yyyy" as a date string.

 

I have a column storing a date in the format "dd/MM/yyyy" (although it should be mentioned that my Sharepoint list column is set to "Single line of text", otherwise it does not recognize the string as a date and fails.) and I am trying to convert that to "yyyy/MM/dd" so when I update an event, it updates it on the correct day.

 

Sharepoint column:

Sharepoint date.JPG

 

Convert function:

Convert.JPG

 

I'm getting the following errors:

Flow convert fail.JPG

 

Can anyone please help me shed some light on a workaround for this please?

 

Your help would be much appreciated!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow failing when converting "dd/MM/yyyy" to "yyyy/MM/dd"

Hi @FlowFail,

 

Please insert the "dd/MM/yyyy" value in a Compose name "Date of pickup", and refer to screenshot below to create the flow:

Capture.PNG 

The expression in the day as below:

first(split(outputs('Date_of_pickup'),'/'))

The expression in the month as below:

first(skip(split(outputs('Date_of_pickup'),'/'),1))

The expression in the year as below:

last(split(outputs('Date_of_pickup'),'/'))

The expression in the New Date of pickup as below:

concat(outputs('year'),'/',outputs('month'),'/',outputs('day'))

The flow would run successfully as below:

Capture.PNG

Capture.PNG

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Flow failing when converting "dd/MM/yyyy" to "yyyy/MM/dd"

Hi @FlowFail,

 

Please insert the "dd/MM/yyyy" value in a Compose name "Date of pickup", and refer to screenshot below to create the flow:

Capture.PNG 

The expression in the day as below:

first(split(outputs('Date_of_pickup'),'/'))

The expression in the month as below:

first(skip(split(outputs('Date_of_pickup'),'/'),1))

The expression in the year as below:

last(split(outputs('Date_of_pickup'),'/'))

The expression in the New Date of pickup as below:

concat(outputs('year'),'/',outputs('month'),'/',outputs('day'))

The flow would run successfully as below:

Capture.PNG

Capture.PNG

 

Best regards,

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

FlowFail
Level: Powered On

Re: Flow failing when converting "dd/MM/yyyy" to "yyyy/MM/dd"

ALICE, YOU ARE THE BEST!!!

 

It's working perfectly.

 

Thank you so much, I honestly could not have done it without you.

WillPage
Level 8

Re: Flow failing when converting "dd/MM/yyyy" to "yyyy/MM/dd"

@v-yuazh-msft why do you use compose in this example instead of initailise variable? Would it do the same thing?

Helpful resources

Announcements
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!

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 Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,478)