Skip to content

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

ParameterTypeDescription
ctxContextThe SDK context.
tokenstringAccess token from getSharePointTokenUserAuth.
options{ siteId: string; listId: string; }The site and list identifiers.
options.siteIdstringThe SharePoint site ID.
options.listIdstringThe 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');

Matterway Assistant SDK Documentation