سؤال

Is it possible to copy the attachments of a list item to a Document library using 2013 designer workflows?

I am able to get the server relative URL of the attachments in the workflow, but I am not sure if there is a way to copy using the server relative URL

enter image description here

Is there a method like copyto that exists for copying files from library to a different library?

هل كانت مفيدة؟

المحلول

I converted the below request as a http request and called it from Designer workflow and it is copying files as expected

$.ajax({
url:"https://tenant.sharepoint.com/sites/sitename/_api/web/GetFileByServerRelativeUrl('/sites/sitename/Lists/ListName/Attachments/11/sample.jpg')/copyTo(strNewUrl='DestinationRelativeURL',bOverWrite=true)",
headers:{"accept":"application/json;odata=verbose","content-type":"application/json;odata=verbose","X-RequestDigest": jQuery("#__REQUESTDIGEST").val()},
method: "POST",
success:function(data){
console.log(data);
},
error:function(xhr){
console.log(xhr);
}
})

Before making this http request, we need to make one http request(_api/contextinfo) to get the RequestDigest

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top