0

I have a SP Designer 2013 workflow which copies a file from FileLibrary1 to FileLibrary2. I did this via the following REST API call:

https://sharepointSite/sites/rootSite/_api/web/folders/GetByUrl('FileLibrary1')/Files/GetByUrl('[%Variable:FileName%]')/copyTo(strNewUrl='[%Variable:URL2%]/[%Variable:FileName%]',bOverWrite=true)"

This works but it not only changes the Modified date, but also the Created date

I have also tried checking the file out beforehand but this has not made any difference

https://sharepointSite/sites/rootSite/_api/web/folders/GetByUrl('[%Variable:URL2%]')/Files/GetByUrl('[%Variable:FileName%]')/CheckOut()

Is there a way I can update the file without changing the Created date?

  • If you do a "move" operation these fields remains the same, but if the move is not an option for you, then you are searching for SystemUpdate(): blog.arvosys.com/2018/07/06/… – Bálint May 20 '19 at 12:05
  • Thanks for your information @Bálint. It was very helpful – AjiIchiban May 21 '19 at 4:09
0

I have realised what was wrong. Using the CopyTo method does retain the the Creation date of the source file. The workflow was deleting the source file after every copy so each time I uploaded the file to the source library, it had a new creation date.

I think I confused the date created of the file in Windows with the Creation date in SP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.