Forum Discussion
REST API -"The attempted operation is prohibited because it exceeds the list view threshold." issue
Tanmay_Parulekar Can you show us the API request endpoint you are using?
Make sure you have added proper filter condition in the API call which will return less than 5000 items in single API call. Also, add $top=5000 in your API call like:
<siteUrl>/_api/web/lists/getbytitle('List Name')/items?$filter=MyChoiceColumn eq 'CHOICE1'&$top=5000
Where MyChoiceColumn is the internal name of your choice column. You can get the internal name of your column by following this article: How to find the Internal name of columns in SharePoint Online?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- Tanmay_ParulekarAug 18, 2023Copper Contributor
You are right about the TOP in answer, but that's not an issue over here
Here is the API endpoint
https://<Sharepoint Site>/_api/web/lists/getByTitle('Library')/items?$select=File/Name&$expand=File&$filter=MyChoiceColumn eq 'CHOICE1'&$top=5000