Substringof not working in cross site lookup

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
DrewKill
Posts: 1
Joined: Fri Dec 04, 2015

04 Dec 2015

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

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

07 Dec 2015

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.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests