Appearance
Function: getDriveFolderItems()
ts
function getDriveFolderItems(client: Client, options: {
itemId: string;
driveId: string;
}): Promise<any>;Defined in: src/ms-graph/sharepointGraph.ts:158
Get all items inside a folder in a SharePoint drive.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | Client | The Microsoft Graph client instance. |
options | { itemId: string; driveId: string; } | The folder and drive identifiers. |
options.itemId | string | The folder ID. |
options.driveId | string | The drive ID. |
Returns
Promise<any>
An array of items within the folder.
Example
ts
const client = await getMsGraphClient(creds);
const items = await getDriveFolderItems(client, { itemId: 'folder-abc', driveId: 'drive-xyz' });
console.log('Folder contains', items.length, 'items');