In this post we look at a recent example of a document library in SharePoint being unable to sort or filter correctly and how to troubleshoot.

The problem
I was recently working on an issue that presented itself at first as pretty strange. A document library in SharePoint was unable to sort by created or modified date in ascending or descending order. There were no really obvious clues as to why this was happening, but during the investigation stages users of the document library started to see this error message:

Pretty unhelpful as far as error messages go, but as it was only affecting one folder within the library I started to look at what other factors could be at play. Here’s the troubleshooting steps I took to resolve the issue
The solution
I started by looking at the document library as a whole, as the number of items was quite big (over 30,000), but nothing that should start hitting any of the hard limits as documented by Microsoft. Following this, I had to dive a bit deeper and start to understand the makeup of this library. To my knowledge there isn’t an in-built way to get an idea of how evenly spread out files/ folders are across a document library, outside of an old favourite of mine – storage metrics!

You can find storage metrics by:
- Pressing the cog > site information > site settings
- Site collection administration > storage metrics
Note: Storage metrics is a feature that has been around a long time, and I’ve got no idea if it is planned on being depreciated any time soon – but whilst it’s around I say use it.
Storage metrics will go some way to help you understand if there is a particularly large folder within the library, which was the case in my example. From there, having reviewed the problem folder I noticed that it contained no subfolders, so I put totals on one of the columns and it showed that the folder contained over 5,000 items – bingo!
In this case, my document library had a relatively flat structure, just one level of folders, which a huge amount of files within which was hitting the list view threshold issues well documented already. After figuring this out, I did the following to resolve the issue:
- Edited the default view to only show items created in the last 12 months, just to allow others to continue to work out of the folder and not disrupt service
- Moved files over 12 months old into an archive location outside of the offending folder
- Indexed the Created and Modified columns to increase sorting/ filtering performance in the document library



Leave a Reply