I'm trying to filter my data through OData where the field FileRef contains lets say "/The root path/folder/subfolder"
, I tried with substringof
like so:
$filter=substringof("sites/my folder/subfolder", FileRef)
But it seems doesn´t work, so I wonder if is there an operator like or something that i can use for achieve this.
The $filter system query option allows clients to filter a collection of resources that are addressed by a request URL. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.
The OData service interface has a fixed number of operations that have uniform meaning across all the resources it can act on. These operations are retrieve, create, update and delete and they map to the GET, POST, PUT/MERGE and DELETE HTTP methods.
Introduction. The Open Data Protocol (OData) enables the creation of REST-based data services, which allow resources, identified using Uniform Resource Identifiers (URIs) and defined in a data model, to be published and edited by Web clients using simple HTTP messages.
OData API filter value which you are selecting for $FILTER parameter is always case sensitive.
Consider contains: $filter=contains(CompanyName,'Alfreds')
$filter=substringof('Alfreds', CompanyName)
for more details see: http://www.odata.org/documentation/odata-version-3-0/url-conventions/ --> 5.1.2.4. Canonical Functions
For me worked $filter=indexof(CompanyName, 'Alfreds') gt -1
. This is case sensitive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With