Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

REST API - Can't expand Title of lookup columns "System.ArgumentException : Value does not fall within the expected range"

$
0
0
I have a list that has more than 12 columns of type lookup with more than 5000 items and I am using a date field as an indexed column so I can restrict the results to meet the list view threshold.  I am also using $select to restrict the columns to meet the lookup column threshold.

If I run the query below it all works as expected:

_api/web/Lists/MyList/items/?$Filter=Created gt '2015-03-10T05:00:00.000Z' and Created lt '2015-03-17T18:25:00.712Z'&$select=Lookup1/Id&$expand=Lookup1



If I run this query it does not work:

_api/web/Lists/MyList/items/?$Filter=Created gt '2015-03-10T05:00:00.000Z' and Created lt '2015-03-17T18:25:00.712Z'&$select=Lookup1/Title&$expand=Lookup1

Error:

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-2147024809, System.ArgumentException</m:code>
<m:message xml:lang="en-US">Value does not fall within the expected range.</m:message>
</m:error>

The lookup column "Lookup1" is using Title as the column's information and this should be working.  What is interesting is that changing the lookup threshold has no effect on this but raising the list item view limit does make it work.  The date range is selecting less than 5000 items.  So what am I missing here? I just want the Title for the lookup column and my query has about 10 items in it.




Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>