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

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

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

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

ALICE, YOU ARE THE BEST!!!

 

It's working perfectly.

 

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

Highlighted
Impactful Individual
Impactful Individual

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (1,849)