MoveAttachmentOrDocument
Moves an attachment or document from one folder to another within SharePoint. Useful for reorganizing content within a document library. The paths specified in SourceFileURL and DestinationFolderURL must be relative to what you have used in URL connection property.
Stored Procedure-Specific Information
Examples of how to execute this procedure follow.To move a document to a different folder within the same library:
/* URL = https://mysite.sharepoint.com/sites/Subsite */ EXEC MoveAttachmentOrDocument SourceFileURL = '/Shared Documents/Source Folder/Subfolder/Original Document.txt', DestinationFolderURL = '/Destination Library/Destination Folder/';
To move a document within the same library:
/* URL = https://mysite.sharepoint.com */ EXEC MoveAttachmentOrDocument SourceFileURL = '/Shared Documents/Dummy_000 2.txt', DestinationFolderURL = '/Shared Documents/';
To move a document in a subsite collection:
/* URL = https://mysite.sharepoint.com/sites/Subsite */ EXEC MoveAttachmentOrDocument SourceFileURL = 'Shared Documents/Test Folder 1/Test Nested Folder 1/Test Document.txt', DestinationFolderURL = 'Shared Documents/Test Folder 2/';
Input
| Name | Type | Required | Description |
| SourceFileURL | String | True | The relative path of the file to be moved. This path is relative to the base URL specified in the SharePoint connection properties. |
| DestinationFolderURL | String | True | The relative path of the destination folder where the file will be moved. This path is also relative to the base URL specified in the SharePoint connection properties. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | Indicates whether the file move operation was successful. Returns 'true' for success and 'false' for failure. |