How to Upsert more than one value in the field Company of the Location entity

Estimated read time 3 min read

Hoping the next experience I am going to share could help to whoever is working on integrations with the oData SuccessFactors API uploading data to entities which have some field defined as a foundation object.

Scenario: Developing a custom interface from SAP HCM to SuccessFactors for maintaining the data of the entity “Location” (FOLocation in OData API Data Dictionary).

Problem: The field Company which is linked to the Foundation Object “Legal Entity” (FOCompany in OData API Data Dictionary) is not handled as an object by the API, you can feel tempted to use the field “companyFlxNav” but it is not upsertable:

Instead, you have to use the field ‘companyFlx’ which is a string. But… how to put more than one company in this field?

Solution: It is necessary to separate the values by the character pipe “|” as follows: 

“companyFlx”: “<cod_1>|<cod_2>| … |<cod_n>”.

Payload example:

[
    {
        “__metadata”: {
            “uri”: “FOLocation(externalCode='<code_of_the_location>’,startDate=datetime’1900-01-01T00:00:00′)”
        },
        “name”: “<location_name>”,
        “status”: “A”,
        “addressAddress1”: “<location_address>,
        “addressCity”: “<location_city>”,
        “addressCountry”: “<3 digit country ISO code>”,
        “addressState”: “<state>”,
        “addressZipCode”: “<zip_code>”,
        “companyFlx”: “0050|0909|0913”
    }
]

 

Bonus:

The following KBA is really helpful to develop this kind of interfaces: 3050437 – How associations between Foundation Objects (FOs) and migrated FOs (MDF FOs) in Employee Central are translated to properties in their OData API entities – SAP SuccessFactors HXM Suite

 

This solution is valid for whatever field to be upserted which has been defined as Foundation Object in SuccessFactors by SAP.

Happy coding.

 

​ Hoping the next experience I am going to share could help to whoever is working on integrations with the oData SuccessFactors API uploading data to entities which have some field defined as a foundation object.Scenario: Developing a custom interface from SAP HCM to SuccessFactors for maintaining the data of the entity “Location” (FOLocation in OData API Data Dictionary).Problem: The field Company which is linked to the Foundation Object “Legal Entity” (FOCompany in OData API Data Dictionary) is not handled as an object by the API, you can feel tempted to use the field “companyFlxNav” but it is not upsertable:Instead, you have to use the field ‘companyFlx’ which is a string. But… how to put more than one company in this field?Solution: It is necessary to separate the values by the character pipe “|” as follows: “companyFlx”: “<cod_1>|<cod_2>| … |<cod_n>”.Payload example:[    {        “__metadata”: {            “uri”: “FOLocation(externalCode='<code_of_the_location>’,startDate=datetime’1900-01-01T00:00:00′)”        },        “name”: “<location_name>”,        “status”: “A”,        “addressAddress1”: “<location_address>,        “addressCity”: “<location_city>”,        “addressCountry”: “<3 digit country ISO code>”,        “addressState”: “<state>”,        “addressZipCode”: “<zip_code>”,        “companyFlx”: “0050|0909|0913”    }] Bonus:The following KBA is really helpful to develop this kind of interfaces: 3050437 – How associations between Foundation Objects (FOs) and migrated FOs (MDF FOs) in Employee Central are translated to properties in their OData API entities – SAP SuccessFactors HXM Suite This solution is valid for whatever field to be upserted which has been defined as Foundation Object in SuccessFactors by SAP.Happy coding.   Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author