Skip to content

Function: getDriveFolderItems()

ts
function getDriveFolderItems(client: Client, options: {
  driveId: string;
  itemId: string;
}): Promise<any>;

Defined in: packages/sdk/src/ms-graph/sharepointGraph.ts:174

Get all items inside a folder in a SharePoint drive.

Parameters

ParameterTypeDescription
clientClientThe Microsoft Graph client instance.
options{ driveId: string; itemId: string; }The folder and drive identifiers.
options.driveIdstringThe drive ID.
options.itemIdstringThe folder 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');

Matterway Assistant SDK Documentation