Cross-Site Lookup dont display folder

Discussions about Cross-site Lookup
Locked
RMIC
Posts: 96
Joined: Sun May 10, 2015

04 Jan 2016

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!

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

07 Jan 2016

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";
}

RMIC
Posts: 96
Joined: Sun May 10, 2015

07 Jan 2016

It Works!

Thanks!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests