cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kam1
Helper I
Helper I

Flow fails when updating file properties. Error: String was not recognized as a valid DateTime.

Hi All,

 

I've built a Flow to my PowerApp which updates a document library.

I have added a DOB field in the powerApp. I have then created a Variable in my Flow (see below)

 

DOB.PNG

 

The variable runs successfully however when i add the variable in the update file properties i receive an error (see below)

 

Flow Error.PNG

 

See below for update file properties details

Capture2.PNG

 

Can anyone advise on what I may be doing wrong here or why the Flow is failing please.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @Kam1 ,

 

You could use the following expression to change the date format to the expected one.

concat(split(variables('varDOB'),'/')[1],'/',split(variables('varDOB'),'/')[0],'/',split(variables('varDOB'),'/')[2])

Then you could fill the output of Compose in the date field.

132.PNG

 

Best Regards,

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

8 REPLIES 8
RezaDorrani
Dual Super User II
Dual Super User II

@Kam1 

 

Check to see the value in the variable when the flow runs.

It looks like the format is not of type datetime.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

 

 

Hey,

In the value it's showing a date just the same as I input into my PowerApp

Capture.PNG

 

Could there possibly be an issue with my Column in the Library

RezaDorrani
Dual Super User II
Dual Super User II

@Kam1 

 

You date 13/12/1995

 

13 cannot be a number for month

thats why it is failing

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

After my last reply I went into site settings and changed the regional settings and set time zone to Dublin, Edinburgh... and Region Locale to English (United Kingdom) ran the App again and it still fails. I would have thought this would default the date to dd/mm/yyyy.

 

P.s The flow runs if the number is under 13 making me think it's sticking to the American date format somewhere, even though it displays as uk date when i select this from the Powerapp

v-bacao-msft
Community Support
Community Support

 

Hi @Kam1 ,

 

You could use the following expression to change the date format to the expected one.

concat(split(variables('varDOB'),'/')[1],'/',split(variables('varDOB'),'/')[0],'/',split(variables('varDOB'),'/')[2])

Then you could fill the output of Compose in the date field.

132.PNG

 

Best Regards,

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

Thanks Barry. Worked first time

Reza,

I can't resolve this date issue even though all looks fine in the SP site. Your solution does work bit unfortunately due to my site settings it doesnt.

Thank you very much for helping out. 👍

RezaDorrani
Dual Super User II
Dual Super User II

Hi @Kam1 

 

Although the solution has worked, it is not ideal.

You will need to analyze why the dates are not coming through in your regional locale.

You would not want to plug in an expression every time you build a flow dealing with dates.


Regards,

Reza

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,941)