Cross-List Lookup Filter

Discussions about Cross-site Lookup
Post Reply
MES5464
Posts: 94
Joined: Mon Aug 26, 2013

04 Sep 2013

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

}

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

04 Sep 2013

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

MES5464
Posts: 94
Joined: Mon Aug 26, 2013

16 Sep 2013

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

}

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest