activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity Activities

Last updated Dec 17, 2024

Upload File

UiPath.MicrosoftOffice365.Activities.Files.UploadFile

Description

Uses the Microsoft Graph Resumable upload API to upload a local file to your OneDrive or SharePoint account.

Scopes

This activity requires the following scopes:

  • Sites.ReadWrite.All

Project compatibility

Windows - Legacy | Windows

Configuration

In the Body of the Activity
  • File to upload - The file to be uploaded. Click Browse docs image next to the field, and then browse to and select the file. This property supports String variables and string formatted values.
    Note: Starting with v2.0.1, the (&) and (#) characters in file names are replaced with an underscore (_). This behavior is caused by the Graph API.
  • Destination folder - The folder where to upload the filer. If left blank, the file is uploaded in the OneDrive root folder. This property supports String variables and string formatted values.
  • New name (optional) - The new name of the file or folder after it is uploaded. This property supports String variables and string formatted values.
  • Conflict behavior - Indicates the conflict resolution behavior in case a file with the same name already exists. Select one of three options: Replace, Fail, Rename. The default value is Replace.

    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

  • Checkin - Indicates whether to checkin the file after upload. If you use SharePoint libraries with version control, the uploaded file becomes visible only if you enable this checkbox. Boolean value.
  • Metadata - The metadata to associate with the uploaded file (it works only for a file stored in a SharePoint Document Library). It should contain two columns, the first one representing the display name of the field (String) and the second its value. This field only supports DataTable values.
  • See the rest of the options in the body of the activity.

    Note: You must use the display name of the Document Library column in the DataTable object passed to the Metadata parameter.

Misc

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

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.

Output

  • Reference as - The uploaded file as a DriveItem. Required if you plan to use the output data in subsequent activities. Enter a DriveItem variable that is different than the one used in the Destination property.

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).
  4. Add the Upload Item 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 Upload API.
    • The API returns the DriveItem value to your output property variable.


  • 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.