> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Delete File or Folder

- Component: `appmixer.microsoft.sharepoint.DeleteFileOrFolder`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.microsoft.sharepoint 3.1.0](https://connectors.appmixer.com/connector/appmixer.microsoft.sharepoint/3.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.microsoft.sharepoint/3.1.0/component/appmixer.microsoft.sharepoint.DeleteFileOrFolder>

Delete a file or folder in Microsoft SharePoint by its ID. A folder is deleted together with its content; deleted items go to the site recycle bin.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Site ID (`siteId`) | text | Site where the drive is located. Used to offer the drives of the site in the Drive ID field. |
| Drive ID (`driveId`) | text | ID of the drive (document library) where the item is located. |
| Item ID (`itemId`) | text | ID of the file or folder to delete. |

## Output ports

### Port `out`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.microsoft.sharepoint.DeleteFileOrFolder",
  "label": "Delete File or Folder",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Delete a file or folder in Microsoft SharePoint by its ID. A folder is deleted together with its content; deleted items go to the site recycle bin.",
  "private": false,
  "auth": {
    "service": "appmixer:microsoft",
    "scope": [
      "Files.ReadWrite.All"
    ]
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "siteId": {
            "type": "string"
          },
          "driveId": {
            "type": "string"
          },
          "itemId": {
            "type": "string"
          }
        },
        "required": [
          "driveId",
          "itemId"
        ]
      },
      "inspector": {
        "inputs": {
          "siteId": {
            "type": "text",
            "label": "Site ID",
            "group": "drive",
            "index": 1,
            "tooltip": "Site where the drive is located. Used to offer the drives of the site in the Drive ID field.",
            "source": {
              "url": "/component/appmixer/microsoft/sharepoint/ListSites?outPort=out",
              "data": {
                "transform": "./ListSites#sitesToSelectArray"
              }
            }
          },
          "driveId": {
            "type": "text",
            "label": "Drive ID",
            "group": "drive",
            "index": 2,
            "tooltip": "ID of the drive (document library) where the item is located.",
            "source": {
              "url": "/component/appmixer/microsoft/sharepoint/ListDrives?outPort=out",
              "data": {
                "messages": {
                  "in/siteId": "inputs/in/siteId"
                },
                "transform": "./ListDrives#drivesToSelectArray"
              }
            }
          },
          "itemId": {
            "type": "text",
            "label": "Item ID",
            "group": "item",
            "index": 3,
            "tooltip": "ID of the file or folder to delete."
          }
        },
        "groups": {
          "drive": {
            "label": "Drive",
            "index": 1
          },
          "item": {
            "label": "Item",
            "index": 2
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {}
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
