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

# appmixer.microsoft.onedrive.DeleteFileOrFolder

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

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

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Drive (`drive`) | select | Select the drive type. |
| Drive ID (`driveId`) | text | ID of the drive where the file is located. |
| Site ID (`siteId`) | text | ID of the site where the file is located. |
| Group ID (`groupId`) | text | ID of the group where the file is located. |
| User ID (`userId`) | text | ID of the user where the file is located. |
| File ID/Folder ID (`itemId`) | text | ID of the file or folder to delete in OneDrive. |

## Output ports

### Port `out`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.microsoft.onedrive.DeleteFileOrFolder",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Delete a file or folder in Microsoft OneDrive by its ID. A folder is deleted together with its content; deleted items go to the OneDrive recycle bin.",
  "version": "1.0.0",
  "dependencies": {
    "module": "1.1.0"
  },
  "private": false,
  "auth": {
    "service": "appmixer:microsoft",
    "scope": [
      "Files.ReadWrite.All"
    ]
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "driveId": {
            "type": "string"
          },
          "siteId": {
            "type": "string"
          },
          "groupId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "drive": {
            "type": "string"
          },
          "itemId": {
            "type": "string"
          }
        },
        "required": [
          "itemId"
        ]
      },
      "inspector": {
        "inputs": {
          "drive": {
            "type": "select",
            "index": 1,
            "label": "Drive",
            "group": "drive",
            "defaultValue": "me",
            "tooltip": "Select the drive type.",
            "options": [
              {
                "label": "My Drive",
                "value": "me"
              },
              {
                "label": "User's Drive",
                "value": "user"
              },
              {
                "label": "Site's Drive",
                "value": "site"
              },
              {
                "label": "Group's Drive",
                "value": "group"
              },
              {
                "label": "Any Drive",
                "value": "drive"
              }
            ]
          },
          "driveId": {
            "type": "text",
            "index": 2,
            "label": "Drive ID",
            "group": "drive",
            "tooltip": "ID of the drive where the file is located.",
            "when": {
              "eq": {
                "drive": "drive"
              }
            },
            "source": {
              "url": "/component/appmixer/microsoft/onedrive/ListDrives?outPort=out",
              "data": {
                "properties": {
                  "variableFetch": true
                },
                "transform": "./ListDrives#sitesToSelectArray"
              }
            }
          },
          "siteId": {
            "type": "text",
            "index": 3,
            "label": "Site ID",
            "group": "drive",
            "tooltip": "ID of the site where the file is located.",
            "when": {
              "eq": {
                "drive": "site"
              }
            },
            "source": {
              "url": "/component/appmixer/microsoft/onedrive/ListSites?outPort=out",
              "data": {
                "properties": {
                  "variableFetch": true
                },
                "transform": "./ListSites#sitesToSelectArray"
              }
            }
          },
          "groupId": {
            "type": "text",
            "index": 4,
            "label": "Group ID",
            "group": "drive",
            "tooltip": "ID of the group where the file is located.",
            "when": {
              "eq": {
                "drive": "group"
              }
            },
            "source": {
              "url": "/component/appmixer/microsoft/onedrive/ListGroups?outPort=out",
              "data": {
                "properties": {
                  "variableFetch": true
                },
                "transform": "./ListGroups#sitesToSelectArray"
              }
            }
          },
          "userId": {
            "type": "text",
            "index": 5,
            "label": "User ID",
            "group": "drive",
            "tooltip": "ID of the user where the file is located.",
            "when": {
              "eq": {
                "drive": "user"
              }
            },
            "source": {
              "url": "/component/appmixer/microsoft/onedrive/ListUsers?outPort=out",
              "data": {
                "properties": {
                  "variableFetch": true
                },
                "transform": "./ListUsers#sitesToSelectArray"
              }
            }
          },
          "itemId": {
            "type": "text",
            "index": 6,
            "group": "item",
            "label": "File ID/Folder ID",
            "tooltip": "ID of the file or folder to delete in OneDrive."
          }
        },
        "groups": {
          "drive": {
            "label": "Drive",
            "index": 1
          },
          "item": {
            "label": "Item",
            "index": 2
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {}
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
