UiPath Documentation
activities
latest
false

Productivity activities

Last updated May 12, 2026

Delete File or Folder

UiPath.MicrosoftOffice365.Activities.Files.DeleteItemConnections

Description

Deletes a file or folder from the specified location in OneDrive or SharePoint.

Scopes

This activity requires the following scopes:

  • Sites.ReadWrite

OR

  • Files.ReadWrite.All

OR

  • Sites.ReadWrite.All

Project compatibility

Windows | Cross-platform

Configuration

  • Microsoft OneDrive & SharePoint connection - The connection for the Microsoft 365 account to use in the activity.
  • File or folder to delete - The specific file or folder to delete. The method to specify the file or folder to be retrieved: Enter Id, Enter Url or Use variable.
    • Folder picker option:
      • File or folder - The location of the file or folder. Browse the OneDrive or SharePoint folders and select a file or folder. This field accepts IResource input.
    • 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.

Example

For more details, also check the following resouces:
  • Description
  • Scopes
  • Project compatibility
  • Configuration
  • Example

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated