Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

REST against External List - filter does not work

$
0
0

I have an external list called AssetTags with a wildcard filter calledAssetTag. It uses a filter field called ItemTag, which is defined as the Identity field in the External Content type definition. The underlying data source is a SQL Server view that uses a UNION operator to combine rows from several tables. Even so, the ItemTag field returned by the view is unique.  I can use the AssetTag filter in a view, and it works perfectly. For example, in the view definition, in the Data Source Filters section, I enterPCV-690570-9 as the filter value, and the view returns just that one item.

Now comes REST. My REST uri is:

https://www.foo.com/_api/web/lists/GetByTitle('AssetTags')/Items?select=ItemTag,TagType&filter=ItemTag+Eq+'PCV-690570-0'

In Fiddler, my request headers are:

User-Agent: Fiddler
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose

The results include every row in the AssetTags list. IOW, the filter is being ignored completely. Also, the select is ignored: the JSON results include all fields. I get the same thing when I paste the URI into a browser instead of using Fiddler.

I have also tried it using the filter name in the uri rather than the name of the field:

https://www.foo.com/_api/web/lists/GetByTitle('AssetTags')/Items?select=ItemTag,TagType&filter=AssetTag+Eq+'PCV-690570-0'

Same result: every row is returned. I have also tried it without the select parameter. Exactly the same results.

What am I doing wrong?


Leigh Webber


Viewing all articles
Browse latest Browse all 7589

Trending Articles