cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kadd
Resolver II
Resolver II

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

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

5 REPLIES 5
NiloferA
Responsive Resident
Responsive Resident

Hello @Kadd ,

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

Kadd
Resolver II
Resolver II

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
Responsive Resident
Responsive Resident

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
Resolver II
Resolver II

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
Resolver II
Resolver II

@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...

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (91,376)