Cross-Site Lookup - Real-time quick search restriction

rss

Posted by Jaydius - Dec 1 ’15 at 09:53

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.

 

  • rostislav
    rostislav
    Moderator
    Member for: 6 years 8 months 14 days
    #1 by rostislav Dec 2 ’15 at 07:48

    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):

    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/library/office/fp142385.aspx.

Displaying 1 to 1 of 1 messages