Cross-site lookup - 'Loading Failed' error
Hi there. I just installed a trial of Cross-site lookup for Sharepoint online (office 365) and added a new lookup to a list.
When I click the dropdown, it inputs all of the items from my list successfully, however if I try and enter text to search, it just says 'Loading error'
Please can anyone help?
When I click the dropdown, it inputs all of the items from my list successfully, however if I try and enter text to search, it just says 'Loading error'
Please can anyone help?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Please, open the browser console (F12). Do any notifications appear there while you're typing?
The console shows:
GET https://mydomain.sharepoint.com/sites/b ... 0601055288 400 (Bad Request)
this only happens when typing - if I use the mouse to select items from the drop down without searching it works ok
GET https://mydomain.sharepoint.com/sites/b ... 0601055288 400 (Bad Request)
this only happens when typing - if I use the mouse to select items from the drop down without searching it works ok
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Did you modify Request items in the Lookup Manager? Please, try to reset it.
I think I can now see the problem - the column I'm using is a calculated column with the following value:
=[Project Number]&" - "&[Project Name]
It seems that the search will not work with this calculated column (if I change it to a regular list item it works).
Is there any work around for this please? thanks for your help
=[Project Number]&" - "&[Project Name]
It seems that the search will not work with this calculated column (if I change it to a regular list item it works).
Is there any work around for this please? thanks for your help
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
It seems that SharePoint REST api does not allow to filter by calculated fields but you can configure filtering by multiple regular fields with the help of 'Request item' template following way:
Code: Select all
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&" +
"$filter=startswith(field1, '" + encodeURIComponent(term) + "') or " +
"startswith(field2, '" + encodeURIComponent(term) + "')&$top=10";
}
Ok so using your example, I replaced 'field1' and 'field2' with my column names from the lookup list, however I got the same results. Is there any other area I should replace?:
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&" +
"$filter=startswith(Project Number, '" + encodeURIComponent(term) + "') or " +
"startswith(Project Name, '" + encodeURIComponent(term) + "')&$top=10";
}
function (term, page) {
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&" +
"$filter=startswith(Project Number, '" + encodeURIComponent(term) + "') or " +
"startswith(Project Name, '" + encodeURIComponent(term) + "')&$top=10";
}
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
You need to use internal names of fields instead of titles:
https://social.msdn.microsoft.com/Forum ... oint-lists
You need to use internal names of fields instead of titles:
https://social.msdn.microsoft.com/Forum ... oint-lists
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests