SAP Knowledge Base Article - Public

2321355 - Single-valued key cannot be represented as a complex value


while trying to upsert using Odata API , we get the following error message 

"message" : "Single-valued key cannot be represented as a complex value"



Reproducing the Issue

In this KBA we are using a sample entity, to reproduce the issue ; please do note this error could be for other entity as well.

Trigger this odata query from any odata rest api client

odata request :



,"degree":"567","endDate":"/Date(1388880000000)/","major":"Engineer","school":"test School","startDate":"/Date(1325721600000)/"}


odata response :

"d" : [

{ "key" : null, "status" : "ERROR", "editStatus" : null, "message" : "Single-valued key cannot be represented as a complex value", "index" : 0, "httpCode" : 500, "inlineResults" : null }



This is because, the response is not supplying the required business key to for further execution/upserting of values


  • Please trigger the following query - https://apiURL/odata/V2/entityName/$metadata
    • apiURL - this URL is specific to the DC you are hosted in
    • entityName - the entity you are trying to upsert the data to
    • ex : for DC2 -$metadata
  • From the extracted metadata,please do check for the similar snippet

<EntityType Name="Background_Education">
<PropertyRef Name="backgroundElementId"/>
<PropertyRef Name="userId"/>

  • From the snippet we could see that, backgroundElemetId and userId is the key - hence these two field should be a part of response uri.
  • So a well written response would be






,"degree":"567","endDate":"/Date(1388880000000)/","major":"Engineer","school":"test School","startDate":"/Date(1325721600000)/"}



Single-valued key cannot be represented as a complex value , upsert failure  , KBA , LOD-SF-INT-API , API & Adhoc API Framework , Problem


SAP SuccessFactors HCM Core 1602