SAP Knowledge Base Article - Public

3447101 - Cannot get Location (e.g. City Name or  Country Name ) via OData API Call

Symptom

You are trying to get City Name or Country Name via API but it only brings Null or Country Code.

Environment

SAP SuccessFactors HXM Suite

Reproducing the Issue

1. You are making a Query to get the Country of the user

https://api12preview.sapsf.eu/odata/v2/PerPerson?$expand=locationNav/addressNavDEFLT/countryNav, locationNav/addressNavDEFLT/cityNav

2. It only returns the country code or a null value

Cause

Country specified configuration is set to picklist 'ISOCountryList'. 
The country field by default should refer to 'Territory' entity that contains code and label information.
 

 

Resolution

Fields 'country' and 'city' are country-specified and configured without picklist for country 'DEU' in CSF Corporate Data Model, so you should not to set picklist 'ISOCountryList' for any country specified configuration since the country field by default should refer to 'Territory' entity that contains code and label information.

If you check CSF Corporate Data Model, only country 'LUX' has picklist 'ISOCountryList' configured for field 'country', and only 'HKG' has picklist 'DISTRICT_HKG' configured for field 'city'.   

For city field, if no picklist set, it is just a String instead of a picklist option so it cannot be expanded. 

See Also

For more details about FOCorporateAddressDEFLT please refer: 

https://help.sap.com/docs/SAP_SUCCESSFACTORS_PLATFORM/d599f15995d348a1b45ba5603e2aba9b/4b19c41829ff4741a3b63a4e082d989b.html?q=corporateAddress

Keywords

Country Nav, Citi Nav, API, Null, Country Code , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Suite all versions