Cross Site Lookup - Filter null values error

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Jaydius
Posts: 43
Joined: Thu Nov 12, 2015

13 Apr 2016

Im trying to filter a field (WOID), but im running in to a 'Loading Failed' error whenever I enter a value to search for. The field does have some blank/null values in the database. Im wondering if that could be the cause? If so, is there a way to stop the filter query from producing the error?

Im using the following filter code:

filter=substringof('" + encodeURIComponent(term) + "', {LookupField})

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

14 Apr 2016

What is the exact error the REST API gives? When filtering open up the console (F12) and check the error message you get in it. It will be an error code with a link, follow the link in your browser. We'll need to see the full link as it appears in the address bar and the actual message that you get at that address.

Also, what is WOID's field type exactly?

Jaydius
Posts: 43
Joined: Thu Nov 12, 2015

19 Apr 2016

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/0 ... s/metadata">

<m:code>-2146232060, Microsoft.SharePoint.SPException</m:code> <m:message xml:lang="en-US">Exception from HRESULT: 0x80131904</m:message> </m:error> The WOID field is a number field. Wanting to be able to use the real time search filtering on the cross site lookup field, e.g. type 2 and see all numbers starting with 2...

User avatar
rostislav
Moderator
Posts: 364
Joined: Mon Oct 19, 2015

20 Apr 2016

You should use the startswith operator:

Code: Select all

...filter=startswith(number, '" + encodeURIComponent(term) + "')...
where number is the internal name of the number column

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests