Filter

Use the $filter query option with a collection endpoint to retrieve a specified subset of collection entries.

The $filter query supports the following logical operators:
  • eq (equals)

  • gt (greater than)
  • lt (less than)
  • ge (greater than or equals)
  • le (less than or equals)
  • ne (not equal)
  • and (logical and)
  • or (logical or)

Unsupported $filter option attributes

The $filter query option supports all Integration Object attributes with the following exceptions.
  • Because integrationKey is unique for each item type, filtering on the topmost level by integrationKey returns a single item. Instead of using the $filter option to get this single item, you can use the following request:

    https://localhost:9002/odata2webservices/InboundProduct/Products('prod1|Staged|Default')
  • For localized attributes, the $filter query option only supports the platform's installation language.

  • Attributes more than one level deep are not supported. For example, $filter=catalogVersion/version eq 'Online' is a valid filter, but $filter=catalogVersion/catalog/id eq 'Default' is not.

The following examples show how to filter by various attributes and properties using the supported operators. For more information about localization for GET requests, see Localization for GET requests.

Filter by a simple attribute

https://localhost:9002/odata2webservices/InboundProduct/Products?$filter=code eq 'prod1'

Filter by the navigation property's integrationKey

https://localhost:9002/odata2webservices/InboundProduct/Products?$filter=catalogVersion/integrationKey ne 'Staged|Default'

Filter by the localized attribute name

https://localhost:9002/odata2webservices/InboundProduct/Products?$filter=name eq 'english product name' 

Filter the localized attribute name to those not including the 'english product name'

https://localhost:9002/odata2webservices/InboundProduct/Products?$filter=name ne 'english product name' 

Filter by multiple predicates

https://localhost:9002/odata2webservices/InboundProduct/Products?$filter=code eq 'prod1' or catalogVersion/integrationKey eq 'Staged|Default'

Filter by the price attribute with values greater than 8 and less than 9

 https://localhost:9002/odata2webservices/InboundPriceRow/PriceRows?$filter=price gt 8m and price le 9m

The following example shows the expected date time format for a GET request to the Integration API.

https://localhost:9002/odata2webservices/InboundProduct/Products?$filter=modifiedTime lt DateTime'2012-05-29T09:13:28'