Delete file or folder
The Delete File or Folder tool for Microsoft 365 SharePoint enables seamless deletion of files or folders within SharePoint document libraries or specified drives. It ensures secure and efficient management of DriveItems with concurrency control to prevent accidental overwrites.
Features
- Supports deletion of both files and folders (DriveItems) within SharePoint document libraries or specified drives.
- Requires Document Library ID and File or Folder ID to precisely target items for deletion.
- Implements ETag concurrency control to ensure operations only proceed if the item has not been modified, preventing conflicts.
- Returns precise HTTP status codes, such as '412 Precondition Failed', to inform users of concurrency conflicts.
- Integrates smoothly with Microsoft 365 SharePoint environments for streamlined file management workflows.
Benefits
- Ensures secure deletion by using concurrency checks to avoid accidental overwrites or data loss.
- Improves document management efficiency by automating removal of files and folders within SharePoint.
- Minimizes errors with precise targeting using Document Library and File/Folder IDs.
- Enhances compliance and governance by managing content lifecycle within Microsoft 365 SharePoint.
- Provides clear operational feedback through HTTP status codes, improving troubleshooting and user experience.
Description
Use this tool for SharePoint document libraries or when you need to specify a drive.Delete a file or a folder (also referred to as DriveItems) from a specified Document Library (also referred to as a Drive).
Parameters
3 parameters
| Name | Type | Description |
|---|---|---|
| documentLibraryIdrequired | string | — |
| fileOrFolderIdrequired | string | — |
| etag | string | ETag value for concurrency control via HTTP 'If-Match' header. Delete succeeds only if driveItems's current ETag matches (prevents overwriting concurrent changes). If mismatch returns 412 Precondition Failed error. |