Page 1 of 1

Cross-List Lookup Filter

Posted: 04 Sep 2013
by MES5464
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";

}

Re: Cross-List Lookup Filter

Posted: 04 Sep 2013
by Dmitry Kozlov
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 ... 42385.aspx

Re: Cross-List Lookup Filter

Posted: 16 Sep 2013
by MES5464
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";

}