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

# List Files

- Component: `appmixer.microsoft.sharepoint.ListFiles`
- Kind: Action
- 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.ListFiles>

List files in Microsoft sharepoint.

## Input ports

### Port `in`

| 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 ID (`parentId`) | text | Specify the ID of the parent folder. Leave empty to use 'root' as the parent. |
| Parent Path (`parentPath`) | text | Specify the path of the parent folder**(Ignored if 'Parent ID' is set)**. Leave empty to use 'root' as the parent. Example: `path/to/parent/folder`. |
| Recursive (`recursive`) | toggle | Check this box to list files recursively. |
| Output Type (`outputType`) | select | Choose whether you want to receive the result set as one complete list, or one item at a time or stream the items to a file. For large datasets, streaming the rows to a file is the most efficient method. |
| Select (`select`) | text | Comma-separated list of properties to include in the response. |
| Order By (`orderby`) | text | Comma-separated list of properties used to sort the order of items in the response collection. |
| Filter (`filter`) | text | Filter string to filter the response based on a set of criteria. |
| 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 `out`

Variables are loaded dynamically from `/component/appmixer/microsoft/sharepoint/ListFiles?outPort=out&ignoreAuth=true`.

### Port `notFound`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.microsoft.sharepoint.ListFiles",
  "label": "List Files",
  "author": "Harsha Surisetty <harsha@client.io>",
  "description": "List files in Microsoft sharepoint.",
  "version": "1.0.1",
  "private": false,
  "auth": {
    "service": "appmixer:microsoft",
    "scope": [
      "Files.Read.All",
      "Sites.Read.All"
    ]
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "driveId": {
            "type": "string"
          },
          "siteId": {
            "type": "string"
          },
          "parentId": {
            "type": "string"
          },
          "parentPath": {
            "type": "string"
          },
          "outputType": {
            "type": "string"
          },
          "select": {
            "type": "string"
          },
          "orderby": {
            "type": "string"
          },
          "filter": {
            "type": "string"
          },
          "recursive": {
            "type": "boolean"
          },
          "fileTypesRestriction": {
            "type": [
              "array",
              "string"
            ],
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "driveId"
        ]
      },
      "inspector": {
        "inputs": {
          "siteId": {
            "type": "text",
            "label": " Site ID",
            "group": "drive",
            "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",
            "group": "drive",
            "tooltip": "ID of the drive where the file is located.",
            "source": {
              "url": "/component/appmixer/microsoft/sharepoint/ListDrives?outPort=out",
              "data": {
                "messages": {
                  "in/siteId": "inputs/in/siteId"
                },
                "transform": "./ListDrives#drivesToSelectArray"
              }
            }
          },
          "parentId": {
            "type": "text",
            "index": 3,
            "label": "Parent ID",
            "group": "parent",
            "tooltip": "Specify the ID of the parent folder. Leave empty to use 'root' as the parent."
          },
          "parentPath": {
            "type": "text",
            "when": {
              "eq": {
                "./recursive": false
              }
            },
            "index": 4,
            "label": "Parent Path",
            "group": "parent",
            "tooltip": "Specify the path of the parent folder<b>(Ignored if 'Parent ID' is set)</b>. Leave empty to use 'root' as the parent. Example: <code>path/to/parent/folder</code>."
          },
          "recursive": {
            "type": "toggle",
            "label": "Recursive",
            "index": 5,
            "defaultValue": false,
            "tooltip": "Check this box to list files recursively."
          },
          "outputType": {
            "type": "select",
            "label": "Output Type",
            "index": 6,
            "defaultValue": "object",
            "tooltip": "Choose whether you want to receive the result set as one complete list, or one item at a time or stream the items to a file. For large datasets, streaming the rows to a file is the most efficient method.",
            "options": [
              {
                "label": "First found",
                "value": "first"
              },
              {
                "label": "All at once",
                "value": "array"
              },
              {
                "label": "One at a time",
                "value": "object"
              },
              {
                "label": "Save To File",
                "value": "file"
              }
            ]
          },
          "select": {
            "type": "text",
            "label": "Select",
            "group": "filters",
            "tooltip": "Comma-separated list of properties to include in the response.",
            "index": 8
          },
          "orderby": {
            "when": {
              "eq": {
                "./recursive": false
              }
            },
            "type": "text",
            "label": "Order By",
            "group": "filters",
            "tooltip": "Comma-separated list of properties used to sort the order of items in the response collection.",
            "index": 9
          },
          "filter": {
            "when": {
              "eq": {
                "./recursive": false
              }
            },
            "type": "text",
            "label": "Filter",
            "group": "filters",
            "tooltip": "Filter string to filter the response based on a set of criteria.",
            "index": 10
          },
          "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": 11,
            "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."
          }
        },
        "groups": {
          "drive": {
            "label": "Drive",
            "index": 1
          },
          "parent": {
            "label": "Parent",
            "index": 2
          },
          "filters": {
            "label": "Filters",
            "index": 3
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "source": {
        "url": "/component/appmixer/microsoft/sharepoint/ListFiles?outPort=out&ignoreAuth=true",
        "data": {
          "properties": {
            "generateOutputPortOptions": true
          },
          "messages": {
            "in/siteId": "inputs/in/siteId",
            "in/driveId": "dummy",
            "in/parentId": "inputs/in/parentId",
            "in/parentPath": "inputs/in/parentPath",
            "in/outputType": "inputs/in/outputType"
          }
        }
      }
    },
    {
      "name": "notFound"
    }
  ],
  "icon": "(data URI omitted)"
}
```
