Filtering Cross-site Lookup
Posted by MES5464 - Feb 14 ’14 at 04:48
Is anyone willing to help me with my cross-site lookup filter?
function (term, page) {
var dt = Date.today();
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Occuring,Location&$orderby=Show_x0020_Start,Show_x0020_End&$filter=year(Show_x0020_Start) eq " + dt.getFullYear() + "&$top=100";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Occuring,Location&$orderby=Show_x0020_Start,Show_x0020_End&$filter=startswith({LookupField}, '" + term + "')&$top=100";
}
-
MES5464MemberMember for: 10 years 29 days
I have been experamenting with other ways to get what I need. While doing so I have attempted to use endswith and substringof in both cases I get the following messages:
The function operator 'endswith' is not not supported or its usage is invalid.
The function operator 'substringof' is not not supported or its usage is invalid.
-
MES5464MemberMember for: 10 years 29 days
Some of the things I have tried.
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Occuring,Location&$orderby=Show_x0020_Start,Show_x0020_End&$filter=endswith({LookupField}, '2014')&$top=100";
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Occuring,Location&$orderby=Show_x0020_Start,Show_x0020_End&$filter=substringof({LookupField}, '2014')&$top=100";
-
Dmitry KozlovAdminMember for: 10 years 4 days
[#2]: Hello,
It seems, MSDN guidance contains incorrect samples. Try the following code:
function (term, page) { var dt = new Date(); if (!term || term.length == 0) { return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,\ {LookupField},Occuring,Location&$orderby=Show_x0020_Start,Show_x0020_End&\ $filter=Show_x0020_Start gt datetime'" + dt.getFullYear() + "-01-01T00:00:00Z'&$top=100"; } ... }
Please, read the following article:
http://neganov.blogspot.ru/2013/06/filtering-items-by-date-range-using.html -
MES5464MemberMember for: 10 years 29 days
Thank you!
-
peter0900MemberMember for: 10 months 16 days
By choosing the view option in the lookup field, you can focus on a portion of the items in a target list, which will help you narrow down your choices.
USA Best Photographers