Page 1 of 1

look up field yes/no

Posted: 03 Jun 2016
by Malboro
hi,

i want to filter field Yes/No but i have loading failed .

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$filter=(facturable eq 'Oui')&$orderby=Created asc&$top=20";

}

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

}

Re: look up field yes/no

Posted: 04 Jun 2016
by Dmitry Kozlov
Hi,

Please, try this:

Code: Select all

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