SAP Knowledge Base Article - Public

3025683 - How to filter records which have a blank field in a query - SAP SuccessFactors OData API

Symptom

You wish to filter out (exclude) or filter in (include only) records which have a blank value on a given field when querying an entity via OData API

Environment

  • SAP SuccessFactors HXM Suite
    • OData API


Resolution

Supposing you're querying EmpJob records and you wish to exclude records which have the healthRisk field blank. The query would look like this:

  • https://<APIURL>/odata/v2/EmpJob?$filter=healthRisk ne 'null'

For the inverse scenario, where you want to query only records which have the field blank:

  • https://<APIURL>/odata/v2/EmpJob?$filter=healthRisk eq 'null'


NOTE: The field must be filterable (property filterable: true) to be included in the query's filter parameter. You can verify if the field is filterable by querying the entity's metadata or manually checking the OData API Data Dictionary. You may refer to:

Keywords

null, blank, no, out, exclude, include, remove, not, result, results, response, payload, api, query, request, filterable, empty, sf, successfactors, ec , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To

Product

SAP SuccessFactors HCM suite all versions