Cross-Site Lookup - Real-time quick search restriction

Discussions about Cross-site Lookup
Locked
Jaydius
Posts: 43
Joined: Thu Nov 12, 2015

01 Dec 2015

Is it possible to either use wildcards or search within the full name of a dropdown choice, rather than the search only matching the characters in sequence?

For example if a choice was:

An example dropdown choice



Typing 'choice' would include this in the real-time search results. Im using the Cross-site lookup on a site, which has dozens of choices on the dropdown, which would be a lot easier to use if it wasnt so unforgiving on what order the words are typed.



Thanks for your help.

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

02 Dec 2015

There are no wildcards, but there is a number of operators you can use with strings, like eq and substringof. For example, if you want to search for exact matches, change your request items function to resemble this one (go to Manage Plumsail Lookups -> select the lookup field -> Advanced settings -> request items):

Code: Select all

function (term, page) {

  return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter={LookupField} eq '" + encodeURIComponent(term) + "'&$top=10";

}


As you can see, we using the eq (equals) operator to get exact matches only. To get the functionality of wildcards you can use the substringof operator or the startswith operator. For more information see this page https://msdn.microsoft.com/en-us/librar ... 42385.aspx.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests