web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copy file error : Stri...
Power Automate
Unanswered

Copy file error : String was not recognized as a valid datetime ??

(0) ShareShare
ReportReport
Posted on by 447

Hello,

 

Hope you are all doing great.

 

I created a workflow that was working fine till yesterday. I copy a file from a site to another using the action "Copy file".

I put the current site, the file to copy, the destination and destination folder... everything was working ...

 

But today, I get errors. nothing is working anymore.

 

the error is :

 

String was not recognized as a valid DateTime.CallStack -- at system.DateTimeParse.Parse(String s,DateTimeFormInfo dtfi, DateTimeStyles styles) ..... etc...

 

I have no date time, i'm just copying a file and things were working before !

 

Site regional settings are set to belgium, even if i change back to english US...the error is still there.

 

Would someone have any idea how to solve this ?

 

Thanks a lot !!

Categories:
I have the same question (0)
  • NiloferA Profile Picture
    on at

    Hello @Kadd ,

    Could you please post screenshots of your Flow actions and also one of the Runs where it failed with detailed Error?

  • Kadd Profile Picture
    447 on at

    Hi @NiloferA 

     

    thanks a lot for your answer

     

    so, the action is 

    fig1.png

     

    the actions right before this are the trigger and the initialisation of the variable, which is text.

    There is nothing else...no date, nothing...

     

    in the flow i get this

     fig2.png

     

    and the error is 

     

    String was not recognized as a valid DateTime. CallStack --    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)

       at Microsoft.SharePoint.SPListItem.SetValue(String strName, Object value, SPField field, Boolean protectFields, Boolean skipValidation)

       at Microsoft.SharePoint.SPListItem.set_Item(Guid fieldId, Object value)

       at Microsoft.SharePoint.Deployment.ListItemSerializer.UpdateFieldData(SPListItem listItem, SPLoggerObject loggerObject, ImportObjectManager objectManager, Guid docId, String fieldName, String value, String value2, Guid gFieldId, Boolean& bCreated, Dictionary`2 brokenFields)

       at Microsoft.SharePoint.Deployment.ListItemSerializer.UpdateFieldDataInternal(SPListItem listItem, SPLoggerObject loggerObject, Guid docId, Boolean& bCreated, SPContentTypeId contentTypeId, ImportObjectManager objectManager, Object listItemFieldsData)

       at Microsoft.SharePoint.Deployment.ListItemSerializer.UpdateFieldData(SPListItem listItem, SPLoggerObject loggerObject, Guid docId, Boolean& bCreated, SPContentTypeId contentTypeId, ImportObjectManager objectManager, Object data)

       at Microsoft.SharePoint.Deployment.ListItemSerializer.SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)

       at Microsoft.SharePoint.Deployment.XmlFormatter.CallSetObjectData(Object obj, SerializationInfo objectData, ISerializationSurrogate surrogate, ISurrogateSelector selector)

    clientRequestId: 977a312b-6c65-4ade-a30f-368e4e788f94

    serviceRequestId: 977a312b-6c65-4ade-a30f-368e4e788f94

     

    thanks a lot !

  • NiloferA Profile Picture
    on at

    Hello @Kadd ,

    Lets check a few things!

    1. Have you tried copying any other file apart from the one which is giving you error?
    2. What type of file are you copying? .docx, xlsx, pdf, etc?
    3. Does your file have any dates within it's content?
    4. Can you try copying the file to some other Library and see what happens?

    Let me know your findings.

  • Kadd Profile Picture
    447 on at

    Hello @NiloferA ,

     

    Sorry for the late reply, i've been pretty busy yesterday.

     

    1. Yes I tried with other types of files ... docx, xlsx, pdf ... those are the 3 types of documents we are working on.

     

    2. the type of file i'm working on at the moment is a docx .... but i also tried with other types and it's not working either

     

    3. Date within it's content ? in the text of the body ? some of them yes but they are manually written. I also tried with a blank file and files with no date inside ...no luck. However, I have a metadata Date field...which is used as a next revision date... but it's there from the beginning, even when the workflow was created and it's working for more than a month with and without a date in.

     

    4. it works within the same site but not when i copy the file to another. and regional setting are identical on both sites.

     

    Thanks

  • Kadd Profile Picture
    447 on at

    @NiloferA 

     

    I found a workaround... instead of copying the file, i recreate it at the destination and this works.

     

    But the problem i have now is that it doesn't replace the file if it already exists. the workflow just crashes.

    So i have to go to the library and delete manually before launching the workflow...which then becomes a bit useless...hmm...

  • NiloferA Profile Picture
    on at

    Hello @Kadd ,

    If that's the case then you can do the following

    1. Add a Delete File action and try to delete the file first
    2. Then add the Create File action
    3. Click on the ellipsis icon on the top right of the Create File action
    4. click on Configure run after
    5. Check the option that says "When Delete File Fails", and the option "When Delete File succeeds" will already be checked and hit Save

    This will ensure that, if the File exists, delete it and then create a new one, if it does not exists then Delete File will encounter an error but still continue to the next action and simply create a new one

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard