Rename an Item

Renames a folder or a file using the Microsoft Graph API.

Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

rename the item to {the name}

What does it do? This is the base syntax for the procedure.

Where does it go? This phrase should be written on a new line.

Is it required? ✅ Yes — This phrase is required in the syntax.

Does it require input data? ✅ Yes — A SharePoint file that will be renamed must be specified for the item and a text value must be specified in place of the name.

the conflict behavior is

What does it do? Specifies the behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.

Where does it go? This phrase should be indented beneath rename the item to the name

Is it required? 🌟 No — This phrase is optional in the syntax.

Does it require input data? ✅ Yes — A text value should be specified as the behavior when a conflict occurs. Possible values are 'fail', 'replace', 'rename'.

Example: the conflict behavior is "replace"

Default: rename

Examples

1. Rename a file

get a folder at "/My Site/My Documents/My Folder"
get the folder's items
rename the first item to "My New File.txt"

Last updated

Was this helpful?