Cross-List Lookup Filter
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";
}
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 Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
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
http://msdn.microsoft.com/en-us/library ... 42385.aspx
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";
}
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";
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests