Cross-Site Lookup dont display folder

rss

Posted by RMIC - Jan 4 ’16 at 04:55

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!

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 4 months 7 days
    #1 by Dmitry Kozlov Jan 7 ’16 at 03:50

    Hi,

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

    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
    Member
    Member for: 6 years 8 months 18 days
    #2 by RMIC Jan 7 ’16 at 10:47

    It Works!

    Thanks!

Displaying 1 to 2 of 2 messages