Page 1 of 1

Cross-Site Lookup dont display folder

Posted: 04 Jan 2016
by RMIC
Hello,


I have a library of files, folders and subfolders.

How can I filter a Cross-Site Lookup that I get only displayed documents and not folders?

Documents within folders / subfolders are displayed.


Many Thanks!

Re: Cross-Site Lookup dont display folder

Posted: 07 Jan 2016
by Dmitry Kozlov
Hi,

Replace the Request items snippet in the Cross-site Lookup manager:

Code: Select all

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

Re: Cross-Site Lookup dont display folder

Posted: 07 Jan 2016
by RMIC
It Works!

Thanks!