UiPath Documentation
activities
latest
false
Productivity activities

Upload Files

Upload Files activity that uploads files to a specified OneDrive or SharePoint location.

UiPath.MicrosoftOffice365.Activities.Files.UploadFilesConnections

Description​

Uploads files to a specified OneDrive or SharePoint location.

Scopes​

This activity requires the following scopes:

  • Sites.ReadWrite.All

OR

  • Sites.Selected
Note:

Sites.Selected works only for SharePoint locations that a SharePoint administrator has granted to your application. Browsing doesn't list any sites, so enter the URL or the ID of the file or folder instead. For setup steps, refer to Restrict access to specific SharePoint sites.

Project compatibility​

Windows | Cross-platform

Configuration​

  • Microsoft OneDrive & SharePoint connection - The connection for the Microsoft 365 account to use in the activity.
  • File(s) - The files to upload. This field accepts IResource input. Use the See more button menu to switch the input mode to Collection Builder.
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 destination folder for the uploaded files. The method to specify the file or folder to be retrieved: Folder picker, Enter Id, Enter Url.
    • Folder picker option - Browse the OneDrive or SharePoint folders and select the files. This field accepts IResource input. If no folder is selected, the default option is the OneDrive root folder.
    • Enter Id option:
      • File or folder Id - The ID of the file or folder. To retrieve the ID, open the file in OneDrive Web and retrieve its URL. The ID is encoded in the URL. For example: if the URL is https://yourcompany.sharepoint.com/Doc.aspx?sourcedoc=%7BA1CA7E78-BA59-4DD4-A6B9-5F5BBC37FA85%7D&file=Merge_sheets.xlsx``, the decoded file ID is A1CA7E78-BA59-4DD4-A6B9-5F5BBC37FA85. %7Band%7Dare the delimiters around the file ID. This field supportsString` type input.
      • SharePoint site address - The URL of the SharePoint site that contains the file or folder. Open your SharePoint site in a browser and retrieve the URL, e.g., https://yourCompany.sharepoint.com/sites/Marketing. This property supports String type input.
      • SharePoint document library - The document library within the indicated SharePoint site that contains the file or folder. Open your SharePoint site in a browser, go to the Documents tab, then retrieve the URL, e.g., https://yourCompany.sharepoint.com/sites/Marketing/Shared%20Documents/Forms/AllItems.aspx. This property supports String type input.
    • Enter Url option:
      • File or folder Url - The URL of the file or folder. This property supports String variables and string formatted values. Retrieve the URL by opening the file in a browser.
    • Use the See more docs image button menu to use a variable or select the Reload Folder Data option if you've modified your folders and need to retrieve the latest data.

Additional options​

Options

  • If files already exist - The expected behavior when a file with the same name already exists in the destination folder. Choose one of the available options from the dropdown menu:
    • Replace - Replaces the existing item. Default option.
    • Don't replace - Fails if an existing item is found.
    • Auto rename - Auto renames the new item by appending a number.
  • Metadata for the uploaded files - The metadata to associate with the uploaded files. The metadata only works for files stored in a SharePoint document library. The library should contain two columns: the display name of the field (String) and the value of the field (Object). This field supports DataTable variables.

Output

  • First file - The uploaded single file returned by the activity. Automatically generated output variable. You can use it as it is or save it with a different name. You can use this in other activities.
  • File list - All uploaded files returned by the activity. Automatically generated output variable. You can use it as it is or save it with a different name. You can use this in other activities.

Example​

For more details, also check the following resources::

  • Description​
  • Scopes​
  • Project compatibility​
  • Configuration​
  • Additional options​
  • Example​

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated