SharePoint Troubleshooting: This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.

Error

“This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator."

To view items, try selecting another view or creating a new view. If you do not have sufficient permissions to create views for this list, ask your administrator to modify the view so that it conforms to the list view threshold.”

https://lh3.googleusercontent.com/-GKFL6txzoGo/WMEhxH2skmI/AAAAAAAAPoY/fN-2w1wDQKs/image_thumb%25255B9%25255D.png?imgmax=800

And if you are to dig into it, the error will occur in your

  • Web Parts
  • Custom Scripts
  • SharePoint Apps
  • CAML Queries

Which is related to that list.

Troubleshooting

The Live View Threshold is an item count which is limited by SharePoint Administrator to process by SharePoint server at a time.

Further elaborating when you are viewing or querying (CAML, ODATA, and REST) against the list SharePoint will process the entire set of items to get the required results even though you have mentioned limits or filters unless it is not indexed.

Thus when it is exceeding threshold limit (5000 default) SharePoint will throw that error to you.

Resolution

Increase the List Threshold as a Temporary Fix

The easiest way is Increase the Threshold List View Limit. But this should be temporary and it is not good for server performance.

First, you can go to Central Administration and then Manage web Applications

https://lh3.googleusercontent.com/-4O_N9HHj8Vc/WMEhy0T0mlI/AAAAAAAAPog/qEHs9R0UBI0/image_thumb%25255B11%25255D.png?imgmax=800

Then select the web application you need to increase the List View threshold. And go to general settings and Resource Throttling.

https://lh3.googleusercontent.com/-bPMvYUQDy1Y/WMEh0BwrzVI/AAAAAAAAPoo/iCC7caU5ufE/image_thumb%25255B13%25255D.png?imgmax=800

Then you can change the List View Threshold to accommodate the list items limit.

https://lh3.googleusercontent.com/-LG1r_TZStHk/WMEh1oPC8bI/AAAAAAAAPow/6nJwNst3hfQ/image_thumb%25255B15%25255D.png?imgmax=800

 

The recommended approach is used to cater to this problem using indexed columns. If you use the index column SharePoint does not need to iterate the entire list to deliver the results.

Let’s have a look at a sample scenario. Assume that you have a list with 6000 items over 5 years time and your default view throws that error.

So first you need to increase the List View Threshold to perform operations as mentioned in the temporary fix.

Then you need to create an Indexed Column. Most common used scenario is use [Created] SharePoint default column as an Indexed column. But it might differ from your scenario.

Create an Index Column

Go to List settings and click on indexed columns.

https://lh3.googleusercontent.com/-hR0a0DnwFYE/WMEh3DwKB2I/AAAAAAAAPo4/qfymuu9Hb_4/image_thumb%25255B17%25255D.png?imgmax=800

Click on the Create a new Index Link.

https://lh3.googleusercontent.com/-2R5HKudtToY/WMEh4dfitKI/AAAAAAAAPpA/mEtYZKd_U6I/image_thumb%25255B19%25255D.png?imgmax=800

Then choose a column that you need to Index and Create It as an index column.

https://lh3.googleusercontent.com/-J_2yRT9PvNo/WMEh5iWMt9I/AAAAAAAAPpI/Hg9mfvDquvI/image_thumb%25255B21%25255D.png?imgmax=800

Then you can edit the Filter in Default view to show only last year by adding [Today]-365 as a filter expression.

https://lh3.googleusercontent.com/-xOqLcI33PJI/WMEh675w5kI/AAAAAAAAPpQ/BVOxq3yEZ38/image_thumb%25255B23%25255D.png?imgmax=800

Then you can change the List Threshold back to 5000. But make sure you are adding [Created] column expression for your CAML queries, REST queries and other queries.