SAP Knowledge Base Article - Public

2481554 - Error "unknown property" in the Upsert response - OData API

Symptom

When trying to Upsert data using OData API, you get below error message:

<d:message>unknown property <fieldName> for <entityName></d:message>

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SAP SuccessFactors HXM Suite
    • OData API

Reproducing the Issue

  1. Send the payload below in the Upsert

    {
        "__metadata": {
            "uri": "cust_attachment"
        },
        "externalCode": "Test",
        "effectiveStartDate":"/Date(1565222400000)/",
        "externalName": "Test",
        "cust_DocumentNav": {
            "__metadata": {
                "uri": "Attachment(8303L)"
            }
        }
    }

  2. The error below is returned.

    <m:properties>
    <d:key m:null="true"></d:key>
    <d:status>ERROR</d:status>
    <d:editStatus>UPSERTED</d:editStatus>
    <d:message>unknown property cust_DocumentNav for cust_attachment</d:message>
    <d:index m:type="Edm.Int32">0</d:index>
    <d:httpCode m:type="Edm.Int32">400</d:httpCode>
    <d:inlineResults m:type="Bag(SFOData.UpsertResult)"></d:inlineResults>
    </m:properties>

Cause

The Upsert request payload wasn't formated properly.

Resolution

The payload from the Upsert request is case sensitive. You need to make sure that all the data passed in the request payload is properly formated according to the OData perspective. In order to do that, you can check the details of the entities being Upserted using OData Data Dictionary.

Taking the example from the "Reproducing the Issue" section, if we check the OData Data Dictionary we can see:

caseSensitive.jpg

Its name is "cust_documentNav" and not "cust_DocumentNav". The capital "D" was the cause of the issue.

Note: the same issue will occur if you send an Upsert with a blank space in the field name, like this:

{
    "__metadata": {
        "uri": "cust_attachment"
    },
    " externalCode": "Test",
}

Note that there is a space in the beginning of "externalCode".

Keywords

successfactors, sf, success factors, odata, api, upsert, insert, unknown property, metadata, meta data, property, field, dictionary, convention, syntax, case sensitive, format , KBA , LOD-SF-INT-API , API & Adhoc API Framework , LOD-SF-INT , Integrations , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM suite all versions