Page 1 of 1

Substringof not working in cross site lookup

Posted: 04 Dec 2015
by DrewKill
I'm trying to do a simple cross site lookup and all I changed in the javascript is filter=substringof



function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=substringof({LookupField}, '" + encodeURIComponent(term) + "')&$top=10";
}



And I get an error Loading Failed

Re: Substringof not working in cross site lookup

Posted: 07 Dec 2015
by Dmitry Kozlov
I've copy-pasted your code in and it works fine for me. Open up your console (press F12), reload the page, expand the dropdown. You should get an error in the console. Copy-paste it here.