We have custom solution which read lookup list contains more than 5000K items in SharePoint list. Due the list threshold, we can only retrieve the items up to 5000K. This the code that we used. I just wondering is there any a solution to get more than 5000K items
public async getLookups(fieldSchema: any, webUrl: string): Promise<any[]> {
const url = `${webUrl}/_api/Web/lists/getbyid('${fieldSchema.LookupListId}')/items?$orderby=${fieldSchema.LookupFieldName}&$top=5000`;
try {
let resp: SPHttpClientResponse = await this.spHttpClient.get(url, SPHttpClient.configurations.v1);
if (resp.ok) {
let json = await resp.json();
return json.value.map((x) => {
return { LookupId: x.ID, LookupValue: x[fieldSchema.LookupFieldName], x };
});
}
}
catch (error) {
console.error(error);
}
return [];
}