Appearance
Function: getListItemsEval()
ts
function getListItemsEval(
ctx: Context,
token: string,
options: {
siteId: string;
listId: string;
}): Promise<any>;Defined in: src/ms-graph/sharepointGraphEval.ts:560
Get all items from a SharePoint list via the Graph API (browser eval variant).
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | The SDK context. |
token | string | Access token from getSharePointTokenUserAuth. |
options | { siteId: string; listId: string; } | The site and list identifiers. |
options.siteId | string | The SharePoint site ID. |
options.listId | string | The SharePoint list ID. |
Returns
Promise<any>
An array of list item objects.
Example
ts
const token = await getSharePointTokenUserAuth(ctx, authProps);
const items = await getListItemsEval(ctx, token, {
siteId: 'contoso.sharepoint.com,abc123,def456',
listId: 'tasks-list-789',
});
console.log('Found', items.length, 'items');