Skip to main content

Rename file or folder

Give a file or folder a new name in the same folder.

Command in the Microsoft 365 toolkit · id ooa.microsoft365/rename_item · 6 inputs (2 required), 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Access tokenCredentialNoMicrosoft Graph access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token.
ItemStringYesPath in the drive (e.g. Reports/q4.xlsx), or id:{item-id}.
New nameStringYesNew name, including the extension for files.
DriveStringNome/driveWhose files: me/drive (your OneDrive), a person (ann@acme.com), a SharePoint site (contoso.sharepoint.com:/sites/Finance), a library of a site by name (contoso.sharepoint.com:/sites/Finance:/Invoices), or sites/{site-id}/drive or drives/{drive-id}. With an app sign-in, name a person or site.
Endpoint addressStringNohttps://graph.microsoft.com/v1.0Graph endpoint; change only for national clouds or testing.
If existsStringNofailWhen the new name is taken in the folder: fail, rename (add a number) or replace.

Outputs​

OutputTypeWhat it is
item_idStringItem id.
web_urlStringLink to the renamed item.