Lookup column, list threshold

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Ali
Posts: 6
Joined: Tue Mar 01, 2016

08 Mar 2016

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?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

09 Mar 2016

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.

Ali
Posts: 6
Joined: Tue Mar 01, 2016

09 Mar 2016

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?

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

09 Mar 2016

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";
}

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests