activities
latest
false
UiPath logo, featuring letters U and I in white
Productivity Activities
Last updated Nov 15, 2024

Move File/Folder

UiPath.MicrosoftOffice365.Activities.Files.MoveItem

Description

Uses the Microsoft Graph Move item API to move a specified file or folder to a new parent folder (Destination folder) with the option to change its name.

After moving the item to the Destination folder, the activity returns a DriveItem object (Reference as) that you can use as an input variable in subsequent activities.
Scopes

This activity requires the following scopes:

  • Sites.ReadWrite.All

Project compatibility

Windows - Legacy | Windows

Configuration

In the Body of the Activity
  • File or folder to move - The file or folder to move as a DriveItem. This object can be retrieved using the Find Files And Folders activity. Use the output property variable from the Find Files and Folders (First or Results). If you're using the Results output property from the Find Files and Folders activity, specify the item in the array that you want to use (e.g., myWorkbooks(0)).
  • Destination folder - The directory to which this item is moved as a DriveItem. If left empty, the root folder is used. This object can be retrieved using the Find Files And Folders activity. Use the output property variable from the Find Files and Folders (First or Results). If you're using the Results output property from the Find Files and Folders activity, specify the item in the array that you want to use (e.g., myFolders(0)).
  • New name (optional) - The name of this item after it is moved. If moving a file, include the file type extension of the item that you're moving (e.g., "MoveItem.docx").

    Note: You can save files or folders for later use in the automation using the Get File/Folder activity.
Properties Panel

Common

  • DisplayName - The display name of the activity in the Designer panel. This property supports String variables and string formatted values.

Input

  • See the options in the body of the activity.

Options

  • Account - The ID or User Principal Name for the user who owns the OneDrive. This parameter must be set for ApplicationIdAndSecret and ApplicationIdAndCertificate authentication types.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level. This field supports Boolean values.

Output

  • Reference as - The name used to refer to the moved file or folder in other activities. Click Plusdocs image on the right side of the field and select Save for Later Use to save the folder for later use in the automation. Alternatively, select Use Saved Value to select a file or folder that you previously saved for later use in the project or select Open in Advanced Editor to enter a VB expression.

How it works

The following steps and message sequence diagram is an example of how the activity works from design time (i.e., the activity dependencies and input/output properties) to run time.

  1. Complete the steps.
  2. Add the Microsoft Office 365 Scope activity to your project.
  3. Add an activity or run an external process that outputs a DriveItem object (e.g., Find Files and Folders, Create Workbook, Copy File/Folder).
  4. Add the Move File/Folder activity inside the Microsoft Office 365 Scope activity.
  5. Enter values for the Input properties.
  6. Create and enter a DriveItem variable for your Output property.
  7. Run the activity.

    • Your input property values are sent to the MoveDriveItem API.
    • The API returns the DriveItem value to your output property variable.


This activity can call different APIs, as follows:

  • If the driveId of the file to move is equal to the driveIdof the Destination folder, uses Move item API.
  • If the driveId of the file to move does not equal the driveId of the Destination folder, uses the Copy item and Delete item APIs (the original file is deleted and replaced by its copy in the destination folder).
  • Description
  • Project compatibility
  • Configuration
  • How it works

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.