Page 1 of 1
Lookup column, list threshold
Posted: 08 Mar 2016
by Ali
Hi
I am using cross site lookup column in sharepoint online, I am getting error because list has more than 500 items.
I am looking for following options:
lookup column populates value from the list when user clicks in the textbox, Is there any option to prevent sending queries without typing anything in the looklup column text box?
I want to send query to the list when user types at least 3 characters, can i do that?
Re: Lookup column, list threshold
Posted: 09 Mar 2016
by Dmitry Kozlov
Hello Ali,
First, you need to create indices for the columns by which Cross-site Lookup filters and sorts the source list: ‘Created’ and the display column:
List settings -> Columns -> Indexed columns.
If it does not help, split the source list into multiple ones and create a lookup column for each of these lists. Next, display a particular lookup on a form conditionally based on some pivot field, say Type or Category.
Re: Lookup column, list threshold
Posted: 09 Mar 2016
by Ali
thank you for your reply but I am looking for different options, if you could please let me know that following options are available or not.
lookup column populates value from the list when user clicks in the textbox, Is there any option to prevent sending queries without typing anything in the looklup column text box?
I want to send query to the list when user types at least 3 characters, can i do that?
Re: Lookup column, list threshold
Posted: 09 Mar 2016
by rostislav
Ali,
This isn't an issue with the length of the filter term, the issue has to do with the limit Microsoft imposes on the size of a list in SharePoint Online. Filtering a list with more that 5k items is not allowed unless you do the following things:
1. Index the columns that you use to filter the list items by:
https://support.office.com/en-us/articl ... 689e8e#bm2
2. orderby will still cause an error if the
result set is bigger than 5k, so what we can do is remove orderby from the first query (that gives all items), but leave it in for the second query e.g.:
Code: Select all
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=startswith({LookupField}, '" + encodeURIComponent(term) + "')&$top=10";
}