Cross site lookup filtered drop down
We installed the cross site lookup for O365. We want to filter the lookup based on a static value. For example, the lookup list has 2 columns: Customer and Status. We created the cross site lookup field "Customer" in our Project list. However, we only want to show customers where Status = "Active". How can we do this?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hello,
Please, open Cross-site Lookup management dialog and expand Advanced settings section. Put the following code into 'Request items' area:
Please, open Cross-site Lookup management dialog and expand Advanced settings section. Put the following code into 'Request items' area:
Code: Select all
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Status\
&$orderby=Created desc&$filter=Status eq 'Active'&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Status\
&$orderby={LookupField}&$filter=startswith({LookupField}, '" + term + "') \
and Status eq 'Active'&$top=10";
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest