Easy way to Copy SharePoint Library Item to Archive Library (Attachment and meta data)

  • 20 February 2020
  • 2 replies
  • 38 views

Badge +2

We are using a Nintex workflow on a SharePoint Library with a Word document attached to Items.

In the Workflow we want to Copy the current version to an Archive Library before entering a review cycle. What is the easiest and practical way to make that Copy SharePoint Item action happening?
I have read all other posts but they are some older and not having the actions in place like we have now in the latest Nintex versions O365. 

Your thoughts and maybe a solution is welcome.

Thanks

Jaap

 


2 replies

Badge +2

Update: I have found 2 articles, 1 from Vadim who explains it for a List Item with attachments:


https://vadimtabakman.com/nintex-workflow-for-office-365-copy-attachments-to-document-library.aspx


and the below one which explains a method for a Library (using the CopyTo webservice)


http://www.benprins.net/2017/05/01/sharepoint-2013-workflow-copy-files-with-rest-api/


I will workout the first one based on the initial workflow done by Vadim and replace the endpoint url to something like this as explained by ben because I need this for a Library and not a List Item Copy.


[%Workflow Context:Current Site URL%]_api/web/folders/GetByUrl('Original Document Location')/Files/getbyurl('[%Variable:currentItemName%]')/CopyTo(strNewUrl='/sites/Meetingsite/DocumentNewLocation/[%Variable:currentItemName%]',bOverWrite=true)


 


If I am not in the right direction, can you let me know :-)

Badge +2

Just got to the one-liner code to copy the attachment across.


See attached 2 actions I have used. https://domain.sharepoint.com/sites/yoursite/subsite/_api/web/getfilebyserverrelativeurl('/sites/yoursite/subsite/Shared%20Documents/yourfilename.docx')/copyto(strnewurl='/sites/yoursite/yoursubsite/YourTargetLibrary/Your(New)FileName.docx',boverwrite=true)

Reply