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

- Component: `appmixer.microsoft.onedrive.MoveFileOrFolder`
- Kind: Action
- Version: 1.1.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.MoveFileOrFolder>

Move/Rename a file or folder in Microsoft OneDrive.

## 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 assigned to a file or folder in OneDrive. |
| File Path/Folder Path (`itemPath`) | text | Path of a file or folder in OneDrive**(Ignored if 'Item ID' is set)**. Example: `path/to/file/file.pdf` |
| New Name (`newName`) | text | New name for a file/folder in OneDrive. |
| Folder ID (`folderId`) | text | The ID of the folder to move the item to. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| ID (`id`) | string | - |
| Name (`name`) | string | - |
| Date Created (`createdDateTime`) | string | - |
| `cTag` | string | - |
| `eTag` | string | - |
| Last Modified Date (`lastModifiedDateTime`) | string | - |
| Size (`size`) | number | - |
| Web URL (`webUrl`) | string | - |
| Reactions (`reactions`) | object | - |
| Comment Count (`reactions.commentCount`) | number | - |
| Created By (`createdBy`) | object | - |
| `createdBy.application` | object | - |
| `createdBy.application.id` | string | - |
| `createdBy.user` | object | - |
| `createdBy.user.id` | string | - |
| `createdBy.user.displayName` | string | - |
| Modified By (`lastModifiedBy`) | object | - |
| `lastModifiedBy.application` | object | - |
| `lastModifiedBy.application.id` | string | - |
| `lastModifiedBy.user` | object | - |
| `lastModifiedBy.user.id` | string | - |
| `lastModifiedBy.user.displayName` | string | - |
| Parent Reference (`parentReference`) | object | - |
| File (`file`) | object | - |
| Mime Type (`file.mimeType`) | string | - |
| File Hashes (`file.hashes`) | object | - |
| File System Info (`fileSystemInfo`) | object | - |
| Image (`image`) | object | - |
| Photo (`photo`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.microsoft.onedrive.MoveFileOrFolder",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "Move/Rename a file or folder in Microsoft OneDrive.",
  "version": "1.1.0",
  "dependencies": {
    "module": "1.1.0"
  },
  "private": false,
  "auth": {
    "service": "appmixer:microsoft",
    "scope": [
      "Files.Read.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"
          },
          "itemPath": {
            "type": "string"
          },
          "newName": {
            "type": "string"
          },
          "folderId": {
            "type": "string"
          }
        },
        "oneOf": [
          {
            "required": [
              "itemPath"
            ]
          },
          {
            "required": [
              "itemId"
            ]
          }
        ],
        "anyOf": [
          {
            "required": [
              "newName"
            ]
          },
          {
            "required": [
              "folderId"
            ]
          }
        ]
      },
      "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,
            "label": "File ID/Folder ID",
            "group": "item",
            "tooltip": "ID assigned to a file or folder in OneDrive."
          },
          "itemPath": {
            "type": "text",
            "index": 7,
            "label": "File Path/Folder Path",
            "group": "item",
            "tooltip": "Path of a file or folder in OneDrive<b>(Ignored if 'Item ID' is set)</b>. Example: <code>path/to/file/file.pdf</code>"
          },
          "newName": {
            "type": "text",
            "index": 8,
            "label": "New Name",
            "tooltip": "New name for a file/folder in OneDrive."
          },
          "folderId": {
            "type": "text",
            "index": 9,
            "label": "Folder ID",
            "tooltip": "The ID of the folder to move the item to."
          }
        },
        "groups": {
          "drive": {
            "label": "Drive",
            "index": 1
          },
          "item": {
            "label": "Item",
            "index": 2
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "options": [
        {
          "label": "ID",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K"
          }
        },
        {
          "label": "Name",
          "value": "name",
          "schema": {
            "type": "string",
            "example": "Q3-report.pdf"
          }
        },
        {
          "label": "Date Created",
          "value": "createdDateTime",
          "schema": {
            "type": "string",
            "example": "2026-03-12T09:41:27Z"
          }
        },
        {
          "label": "cTag",
          "value": "cTag",
          "schema": {
            "type": "string",
            "example": "\"c:{4E5F6A7B-8C9D-4E0F-A1B2-C3D4E5F6A7B8},2\""
          }
        },
        {
          "label": "eTag",
          "value": "eTag",
          "schema": {
            "type": "string",
            "example": "\"{4E5F6A7B-8C9D-4E0F-A1B2-C3D4E5F6A7B8},2\""
          }
        },
        {
          "label": "Last Modified Date",
          "value": "lastModifiedDateTime",
          "schema": {
            "type": "string",
            "example": "2026-03-12T10:05:13Z"
          }
        },
        {
          "label": "Size",
          "value": "size",
          "schema": {
            "type": "number",
            "example": 184213
          }
        },
        {
          "label": "Web URL",
          "value": "webUrl",
          "schema": {
            "type": "string",
            "example": "https://contoso-my.sharepoint.com/personal/megan_bowen_contoso_com/Documents/Reports/Q3-report.pdf"
          }
        },
        {
          "label": "Reactions",
          "value": "reactions",
          "schema": {
            "type": "object",
            "example": {
              "commentCount": 0
            }
          }
        },
        {
          "label": "Comment Count",
          "value": "reactions.commentCount",
          "schema": {
            "type": "number",
            "example": 0
          }
        },
        {
          "label": "Created By",
          "value": "createdBy",
          "schema": {
            "type": "object",
            "example": {
              "application": {
                "id": "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe",
                "displayName": "Microsoft Teams Services"
              },
              "user": {
                "email": "megan.bowen@contoso.com",
                "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
                "displayName": "Megan Bowen"
              }
            }
          }
        },
        {
          "label": "createdBy.application",
          "value": "createdBy.application",
          "schema": {
            "type": "object",
            "example": {
              "id": "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe",
              "displayName": "Microsoft Teams Services"
            }
          }
        },
        {
          "label": "createdBy.application.id",
          "value": "createdBy.application.id",
          "schema": {
            "type": "string",
            "example": "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe"
          }
        },
        {
          "label": "createdBy.user",
          "value": "createdBy.user",
          "schema": {
            "type": "object",
            "example": {
              "email": "megan.bowen@contoso.com",
              "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
              "displayName": "Megan Bowen"
            }
          }
        },
        {
          "label": "createdBy.user.id",
          "value": "createdBy.user.id",
          "schema": {
            "type": "string",
            "example": "48d31887-5fad-4d73-a9f5-3c356e68a038"
          }
        },
        {
          "label": "createdBy.user.displayName",
          "value": "createdBy.user.displayName",
          "schema": {
            "type": "string",
            "example": "Megan Bowen"
          }
        },
        {
          "label": "Modified By",
          "value": "lastModifiedBy",
          "schema": {
            "type": "object",
            "example": {
              "application": {
                "id": "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe",
                "displayName": "Microsoft Teams Services"
              },
              "user": {
                "email": "megan.bowen@contoso.com",
                "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
                "displayName": "Megan Bowen"
              }
            }
          }
        },
        {
          "label": "lastModifiedBy.application",
          "value": "lastModifiedBy.application",
          "schema": {
            "type": "object",
            "example": {
              "id": "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe",
              "displayName": "Microsoft Teams Services"
            }
          }
        },
        {
          "label": "lastModifiedBy.application.id",
          "value": "lastModifiedBy.application.id",
          "schema": {
            "type": "string",
            "example": "cc15fd57-2c6c-4117-a88c-83b1d56b4bbe"
          }
        },
        {
          "label": "lastModifiedBy.user",
          "value": "lastModifiedBy.user",
          "schema": {
            "type": "object",
            "example": {
              "email": "megan.bowen@contoso.com",
              "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
              "displayName": "Megan Bowen"
            }
          }
        },
        {
          "label": "lastModifiedBy.user.id",
          "value": "lastModifiedBy.user.id",
          "schema": {
            "type": "string",
            "example": "48d31887-5fad-4d73-a9f5-3c356e68a038"
          }
        },
        {
          "label": "lastModifiedBy.user.displayName",
          "value": "lastModifiedBy.user.displayName",
          "schema": {
            "type": "string",
            "example": "Megan Bowen"
          }
        },
        {
          "label": "Parent Reference",
          "value": "parentReference",
          "schema": {
            "type": "object",
            "example": {
              "driveType": "business",
              "driveId": "b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7",
              "id": "01BYE5RZ5MYLM2SMX75ZBIPQZIHT6OAYPB",
              "path": "/drives/b!t18F8ybsHUq1z3LTz8xvZqP8zaSWjkFNhsME-Fepo75dTf9vQKfeRblBZjoSQrd7/root:/Reports"
            }
          }
        },
        {
          "label": "File",
          "value": "file",
          "schema": {
            "type": "object",
            "example": {
              "mimeType": "application/pdf",
              "hashes": {
                "quickXorHash": "dF5ZsBeIxH2TmGCKUf6Pk9PMUkE="
              }
            }
          }
        },
        {
          "label": "Mime Type",
          "value": "file.mimeType",
          "schema": {
            "type": "string",
            "example": "application/pdf"
          }
        },
        {
          "label": "File Hashes",
          "value": "file.hashes",
          "schema": {
            "type": "object",
            "example": {
              "quickXorHash": "dF5ZsBeIxH2TmGCKUf6Pk9PMUkE="
            }
          }
        },
        {
          "label": "File System Info",
          "value": "fileSystemInfo",
          "schema": {
            "type": "object",
            "example": {
              "createdDateTime": "2026-03-12T09:41:27Z",
              "lastModifiedDateTime": "2026-03-12T10:05:13Z"
            }
          }
        },
        {
          "label": "Image",
          "value": "image",
          "schema": {
            "type": "object",
            "example": {
              "height": 1080,
              "width": 1920
            }
          }
        },
        {
          "label": "Photo",
          "value": "photo",
          "schema": {
            "type": "object",
            "example": {
              "takenDateTime": "2026-03-10T14:22:05Z",
              "cameraMake": "Apple",
              "cameraModel": "iPhone 15 Pro"
            }
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
