Cross-List Lookup Filter

rss

Posted by MES5464 - Sep 4 ’13 at 09:46

Are there any constants we can use in the filter portion of a "Request items" function?

Like a Now(), Today(), etc?

 

This is what I have so far:

function (term, page) {

if (!term || term.length == 0) {

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}, Occuring, Location&$orderby=Show_x0020_Start, Show_x0020_End asc&filter=(new Date(Show_x0020_Start).getFullYear()>=Date().getFullYear())&$top=10";

}

return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}, Occuring, Location&$orderby={LookupField} asc&$filter=startswith({LookupField}, '" + term + "')&$top=10";

}

  • Dmitry
    Dmitry
    Admin
    Member for: 7 years 6 months
    #1 by Dmitry Sep 4 ’13 at 12:56

    Cross-site Lookup column uses OData queries. You can find the complete list of available operations in the following article:
    http://msdn.microsoft.com/en-us/library/office/fp142385.aspx

  • MES5464
    Member
    Member for: 6 years 3 months 15 days
    #2 by MES5464 Sep 16 ’13 at 04:59

    What am I doing wrong here?:

     

    function (term, page) {

    if (!term || term.length == 0) {

    return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Office,Email,Classification&$orderby={LookupField}&filter=startswith(Classification, 'Employee')&$top=10";

    }

    return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Office,Email,Classification&$orderby={LookupField}&$filter=startswith({LookupField}, '" + term + "')&$top=10";

    }

Displaying 1 to 2 of 2 messages