Copy an Item to a Folder

Copies an item (folder or file) to a given folder using the Microsoft Graph API.

Syntax

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

copy the item to the folder

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 — The item (folder or file) that will be copied must be specified for the item and the destination folder where the file will be copied must be specified for the folder.

the item name is

What does it do? Specifies the new name for the copy. If this isn't provided, the same name will be used as the original.

Where does it go? This phrase should be indented beneath copy the item to the folder

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 new name for the copy. If this isn't provided, the same name will be used as the original.

Example: the item name is "item 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 copy the item to the folder

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 "conflict behavior"

Default: rename

Examples

1. Copy an item to a folder

get a folder at "/My Site/My Documents/My Folder"
use the above as the source folder
get a folder at "/My Site/My Documents/My Other Folder"
use the above as the destination folder
copy the source folder to the destination folder

Last updated

Was this helpful?