MoveResource
Relocates a file or folder within the OneDrive directory structure, maintaining metadata and permissions.
Stored Procedure Specific Information
Microsoft OneDrive allows only a small subset of columns to be used in the Exec query. DestinationID and either of ResourcePath or ResourceId is required to move the resource. These columns can typically be used with only = comparison.
If file is present in the root folder of a OneDrive account, then mention the file name directly for the value of ResourcePath.
For example:
EXECUTE MoveResource ResourcePath = 'Book.xlsx', DestinationID = '01JSGDQ3MFCITWE4PQKFAY6KH5LHJKPYU5'
If file is present inside a child folder of a OneDrive account, then you need to specify the path of the file starting from child folder name for the value of ResourcePath.
For example:
EXECUTE MoveResource ResourcePath = 'Notebooks/test.png', DestinationID = '01JSGDQ3MFCITWE4PQKFAY6KH5LHJKPYU5'
You can also move the resource by providing the ResourceId and DestinationID as well.
For example:
EXECUTE MoveResource ResourceId = '01CYQN2MFPR6NIWVZNMNFL3SL4E3KF7IHY', DestinationID = '01JSGDQ3MFCITWE4PQKFAY6KH5LHJKPYU5'
Input
| Name | Type | Required | Description |
| DestinationID | String | True | ID of the destination folder where the resource should be moved. |
| ResourcePath | String | False | Path to the resource to be moved. Either ResourcePath or ResourceId must be provided to identify the item. |
| ResourceId | String | False | Unique identifier of the resource to move. Either ResourceId or ResourcePath must be provided. |
| DriveId | String | False | ID of the drive containing the resource. Required only if the resource is located in a drive different from the user's default drive. |
Result Set Columns
| Name | Type | Description |
| Success | String | Indicates whether the move operation was successful. Returns success status or error details. |