SAP Knowledge Base Article - Public

3484664 - Unable To Filter a Phone Number in OData Endpoint

Symptom

It is possible to see that fields such as "NormalisedPhone" and "NormalisedMobile" are filterable=true, however, when performing a GET call using these fields as filter like the below example, no results are returned:

https://myxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/IndividualCustomerCollection?$filter=NormalisedPhone eq '+123456789'

or

https://myxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/IndividualCustomerCollection?$filter=NormalisedPhone eq '123456789'

Environment

SAP Cloud for Customer

Cause

The special character "+" needs to be encoded as "%2B" for it to be considered.

Resolution

Perform the same GET call but swap + for %2B, example:

https://myxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/IndividualCustomerCollection?$filter=NormalisedPhone eq '%2B123456789'

This should correctly return results.

See Also

2330688 - How to Use Methods And Filters in OData Services

Keywords

Fone; Telephone; Odata; mobile phone; area; code;  , KBA , LOD-CRM-INT-API , OData API (C4C Only) , How To

Product

SAP Cloud for Customer core applications 2405