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

# New File

- Component: `appmixer.microsoft.sharepoint.NewFile`
- Kind: Trigger
- Version: 1.0.1
- 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.NewFile>

This trigger fires every time there's a new file uploaded to the selected Drive.

## Properties

| Field | Type | Description |
| --- | --- | --- |
| Site ID (`siteId`) | text | Provide a site ID. |
| Drive ID (`driveId`) | text | ID of the drive where the file is located. |
| Parent Path (`parentPath`) | text | Specify the path of the parent folder. Leave empty to use the selected Drive as the parent. Example: `path/to/parent/folder`. |
| File Types (`fileTypesRestriction`) | multiselect | Restrict the results to specific file types. If no file types are selected, ALL file types will be monitored including folders. |

## Output ports

### Port `file`

| Field | Type | Description |
| --- | --- | --- |
| @Odata.Type (`@odata.type`) | string | - |
| Created By (`createdBy`) | object | - |
| Created Date Time (`createdDateTime`) | string | - |
| E Tag (`eTag`) | string | - |
| Item ID (`id`) | string | - |
| Last Modified By (`lastModifiedBy`) | object | - |
| Last Modified Date Time (`lastModifiedDateTime`) | string | - |
| Name (`name`) | string | - |
| Parent Reference (`parentReference`) | object | - |
| Web Url (`webUrl`) | string | - |
| C Tag (`cTag`) | string | - |
| File (`file`) | object | - |
| File System Info (`fileSystemInfo`) | object | - |
| Shared (`shared`) | object | - |
| Size (`size`) | number | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.microsoft.sharepoint.NewFile",
  "label": "New File",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "This trigger fires every time there's a new file uploaded to the selected Drive.",
  "version": "1.0.1",
  "private": false,
  "webhook": true,
  "tick": true,
  "auth": {
    "service": "appmixer:microsoft",
    "scope": [
      "Files.Read.All",
      "Sites.Read.All",
      "Subscription.Read.All"
    ]
  },
  "properties": {
    "schema": {
      "properties": {
        "siteId": {
          "type": "string"
        },
        "driveId": {
          "type": "string"
        },
        "parentPath": {
          "type": "string"
        },
        "fileTypesRestriction": {
          "type": [
            "array",
            "string"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "siteId",
        "driveId"
      ]
    },
    "inspector": {
      "inputs": {
        "siteId": {
          "type": "text",
          "label": " Site ID",
          "index": 1,
          "tooltip": "Provide a site ID.",
          "source": {
            "url": "/component/appmixer/microsoft/sharepoint/ListSites?outPort=out",
            "data": {
              "transform": "./ListSites#sitesToSelectArray"
            }
          }
        },
        "driveId": {
          "type": "text",
          "index": 2,
          "label": "Drive ID",
          "tooltip": "ID of the drive where the file is located.",
          "source": {
            "url": "/component/appmixer/microsoft/sharepoint/ListDrives?outPort=out",
            "data": {
              "messages": {
                "in/siteId": "properties/siteId"
              },
              "transform": "./ListDrives#drivesToSelectArray"
            }
          }
        },
        "parentPath": {
          "type": "text",
          "index": 3,
          "label": "Parent Path",
          "group": "parent",
          "tooltip": "Specify the path of the parent folder. Leave empty to use the selected Drive as the parent. Example: <code>path/to/parent/folder</code>."
        },
        "fileTypesRestriction": {
          "type": "multiselect",
          "options": [
            {
              "content": "Images (any format, image/*)",
              "value": "image/"
            },
            {
              "content": "Videos (any format, video/*)",
              "value": "video/"
            },
            {
              "content": "Audio files (any format, audio/*)",
              "value": "audio/"
            },
            {
              "content": "Documents and text files (any format text/*)",
              "value": "text/"
            },
            {
              "content": "PDF files (application/pdf)",
              "value": "application/pdf"
            },
            {
              "content": "Word files (.docx)",
              "value": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
            },
            {
              "content": "Excel files (.xlsx)",
              "value": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
            }
          ],
          "defaultValue": [],
          "index": 3,
          "label": "File Types",
          "tooltip": "Restrict the results to specific file types. If no file types are selected, ALL file types will be monitored including folders."
        }
      }
    }
  },
  "outPorts": [
    {
      "name": "file",
      "options": [
        {
          "label": "@Odata.Type",
          "value": "@odata.type",
          "schema": {
            "type": "string",
            "example": "#microsoft.graph.driveItem"
          }
        },
        {
          "label": "Created By",
          "value": "createdBy",
          "schema": {
            "type": "object",
            "properties": {
              "user": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "title": "Created By.User.Email"
                  },
                  "id": {
                    "type": "string",
                    "title": "Created By.User.Id"
                  },
                  "displayName": {
                    "type": "string",
                    "title": "Created By.User.Display Name"
                  }
                },
                "title": "Created By.User"
              }
            },
            "example": {
              "user": {
                "displayName": "John Smith",
                "id": "abc-123"
              }
            }
          }
        },
        {
          "label": "Created Date Time",
          "value": "createdDateTime",
          "schema": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z"
          }
        },
        {
          "label": "E Tag",
          "value": "eTag",
          "schema": {
            "type": "string",
            "example": "aYzpCQUJDMTIz.1"
          }
        },
        {
          "label": "Item ID",
          "value": "id",
          "schema": {
            "type": "string",
            "example": "01DEF456GHI789"
          }
        },
        {
          "label": "Last Modified By",
          "value": "lastModifiedBy",
          "schema": {
            "type": "object",
            "properties": {
              "user": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "title": "Last Modified By.User.Email"
                  },
                  "id": {
                    "type": "string",
                    "title": "Last Modified By.User.ID"
                  },
                  "displayName": {
                    "type": "string",
                    "title": "Last Modified By.User.Display Name"
                  }
                },
                "title": "Last Modified By.User"
              }
            },
            "example": {
              "user": {
                "displayName": "John Smith",
                "id": "abc-123"
              }
            }
          }
        },
        {
          "label": "Last Modified Date Time",
          "value": "lastModifiedDateTime",
          "schema": {
            "type": "string",
            "example": "2026-01-15T10:30:00Z"
          }
        },
        {
          "label": "Name",
          "value": "name",
          "schema": {
            "type": "string",
            "example": "new-document.docx"
          }
        },
        {
          "label": "Parent Reference",
          "value": "parentReference",
          "schema": {
            "type": "object",
            "properties": {
              "driveType": {
                "type": "string",
                "title": "Parent Reference.Drive Type"
              },
              "driveId": {
                "type": "string",
                "title": "Parent Reference.Drive ID"
              },
              "id": {
                "type": "string",
                "title": "Parent Reference.ID"
              },
              "path": {
                "type": "string",
                "title": "Parent Reference.Path"
              },
              "siteId": {
                "type": "string",
                "title": "Parent Reference.Site ID"
              }
            },
            "example": {
              "driveId": "b!xyz123",
              "id": "01ABC000",
              "path": "/drive/root:/Documents"
            }
          }
        },
        {
          "label": "Web Url",
          "value": "webUrl",
          "schema": {
            "type": "string",
            "example": "https://mycompany.sharepoint.com/sites/team/Shared%20Documents/new-document.docx"
          }
        },
        {
          "label": "C Tag",
          "value": "cTag",
          "schema": {
            "type": "string",
            "example": "aYzpCQUJDMTIz.1"
          }
        },
        {
          "label": "File",
          "value": "file",
          "schema": {
            "type": "object",
            "properties": {
              "hashes": {
                "type": "object",
                "properties": {
                  "quickXorHash": {
                    "type": "string",
                    "title": "File.Hashes.Quick Xor Hash"
                  }
                },
                "title": "File.Hashes"
              },
              "mimeType": {
                "type": "string",
                "title": "File.Mime Type"
              }
            },
            "example": {
              "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
            }
          }
        },
        {
          "label": "File System Info",
          "value": "fileSystemInfo",
          "schema": {
            "type": "object",
            "properties": {
              "createdDateTime": {
                "type": "string",
                "title": "File System Info.Created Date Time"
              },
              "lastModifiedDateTime": {
                "type": "string",
                "title": "File System Info.Last Modified Date Time"
              }
            },
            "example": {
              "createdDateTime": "2026-01-15T10:30:00Z",
              "lastModifiedDateTime": "2026-01-15T10:30:00Z"
            }
          }
        },
        {
          "label": "Shared",
          "value": "shared",
          "schema": {
            "type": "object",
            "properties": {
              "scope": {
                "type": "string",
                "title": "Shared.Scope"
              }
            },
            "example": {
              "scope": "users"
            }
          }
        },
        {
          "label": "Size",
          "value": "size",
          "schema": {
            "type": "number",
            "example": 12456
          }
        }
      ]
    }
  ],
  "icon": "(data URI omitted)"
}
```
