Error: The attempted operation is prohibited because it exceeds the list view threshold.

This may be caused by trying to sort or group items from a list containing more than 5000 items, when using the Lightning Conductor Object Model rollup.

SharePoint Online has a 5000-item limit list view threshold, which cannot be changed. You can have up to 30 million items in a list or library, and the standard AllItems view will display them all as you scroll down. But you will find that if you try to create a new view of the list/library that does not show folders, and that sorts, groups, or filters by some column, you will see a List View Threshold error.

 You can specify some columns to be indexed in your list or library, and this will help with filtering the items, but not with sorting them. Grouping items also entails sorting them first, so you will likely also see an error when trying to group by the items.

When a list or library that has over 5000 items is included in a Lightning Conductor Object Model rollup scope, and you try to add a sort or grouping, or a filter that returns more than 5000 items, you will see an error in the web part (Some items could be missing from rollup, because errors have occurred during item retrieval), and no results will appear.

Depending on your use case, one way to prevent this in the Lightning Conductor might be to add a filter that reduces the results to under 5000 items, and then sorting and grouping will also work. For example, perhaps only items within some date range are actually relevant to people viewing the Lightning Conductor results. Or only items related to a certain project. As long as the column you are filtering by has been indexed in the list, the Lightning Conductor should be able to filter for values in that column.

The Lightning Conductor has a Batch Size option (on the Data Source tab) that will help if your scenario requires first retrieving all items (more than 5000) and then filtering after item retrieval, for example via code in the Lightning Conductor's Advanced Filter feature. The default setting for Batch Size is 5000, since this is the default SharePoint List View Threshold. But if you are using the Lightning Conductor in SharePoint Server, you may have changed the LVT to a different value, so you may wish to modify the Batch Size.

If the above suggestion doesn't meet your needs, then the best way in the Lightning Conductor to completely avoid a list view threshold error when you wish to sort or group by values in a large list/library is to switch from using the Object Model rollup to using the Search Rollup. For this scenario, please especially note the section about sorting and filtering in our article about using Managed Properties.

 

Published January 13, 2023