Fix “Value does not fall within the expected range” Error in SharePoint

Problem: SharePoint site gave “System.ArgumentException: Value does not fall within the expected range” error!

Here are some possible root causes and solutions:

Case 1: While fetching List item Lookup values programmatically

Root cause: List view threshold value exceeded! This occurs due to the throttling limit on the list view lookup threshold value under web application settings. Try increasing it.

  • Go to Central Administration >> Application Management >> Manage web applications
  • Select your web application, click on General Settings >> Resource Throttling from the ribbon
  • Enter the value for List View Lookup Threshold. E.g. 36
    Fix "Value does not fall within the expected range" Error in SharePoint

PowerShell script to increase list view lookup threshold value.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$WebApp = Get-SPWebApplication ""

#Set List View Lookup Threshold  
$WebApp.MaxQueryLookupFields = 36

Case 2: Invalid Field Names

When fetching fields, use internal field names or check whether the particular field exists before trying to get its value. E.g. Use item.Fields.ContainsField(“Title”) before fetching or updating a specific field. So, if you got this error after activating a feature or deploying a solution, the culprit is your recent feature/solution!

Case 3: During Check-In under SharePoint Document Library

Got this error while checking in a document ? Well, the solution is simple – Do not set the required field property to true on your content types!

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

One thought on “Fix “Value does not fall within the expected range” Error in SharePoint

  • June 5, 2018 at 7:30 AM

    Hi I’m Getting this error while clicking version history of Documents. Any idea about this?


Leave a Reply