OneDrive Business icon

OneDrive Business

Access OneDrive Business files and folders

File → Rename

AI-generated

Summary

Renames a file in OneDrive for Business (user drive or site drive) by updating its name.

Inputs

  • driveType (required) — Type of drive to access (User Drive or Site Drive). Accepted values: 'user', 'site'.
  • userId (required) — User principal name or ID (required when driveType is 'user').
  • siteId (required) — SharePoint site ID (required when driveType is 'site').
  • fileId (required) — File item ID or path from drive root (e.g., '/Documents/file.pdf').
  • newName (required) — New filename for the file.

Output shape

array of objects

Returns an array containing a single element. That element is an array of result objects, one per input item. Each result object contains the renamed file's metadata in the 'json' field and the original input item index in 'pairedItem'.

Examples

Example 1: Rename a file in a user's OneDrive by its ID

Set driveType='user', provide userId, set fileId to the file's ID, and newName to the desired filename.

Example 2: Rename a file in a SharePoint site by path

Set driveType='site', provide siteId, set fileId to the file's path (e.g., '/Documents/report.pdf'), and newName to the desired filename.

Links

Discussion