cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Required property hr is missing

khaled_kalo
Explorer
0 Kudos

Hi,

I am trying to create/upsert a new user in the SuccessFactors system using SAP Cloud Integration iFlow. I am using XSLT mapping with the SuccessFactors Adapter to post to SF. However, I am confused about an error with the hr property. The error message is as follows:

<message lang="en-US">ChangeSet index 1 - Please add required properties in payload. Required property hr is missing. 
                You can check which properties are required for an entity in Admin Center > OData API Data Dictionary or the entity metadata. with the index 0
</message>

XSLT-mapping:

I can do it with Postman, and it works. My payload in Postman is as follows:

{
    "__metadata": {
        "uri": "https://api2.successfactors.eu/odata/v2/User('81000001')",
        "type": "SFOData.User"
    },
    "userId": "81000001",
    "username": "TestMax",
    "country": "CHE",
    "status": "t",
    "timeZone": "Europe/Zurich",
    "hr": {
        "__metadata": {
            "uri": "User('81000002')",
            "type": "SFOData.User"
        }
    }
}

I think the structure of the XSLT mapping for hr is incorrect because hr is not like other properties; it is an object.

<hr> <User> <userId> <xsl:text>NO_HR</xsl:text> </userId> </User></hr>

Do you have any advice for me? Have you had any experience with errors related to the hr property?

Thanks.

View Entire Topic
daviddasilva
Active Contributor
0 Kudos

Hi,

Can you double check the API user has the Permissions for Human Resource as shown in this help page

Does this issue happen with all users you are trying to create?

Kind regards,

David

MatthiasS_Orbis
Newcomer
0 Kudos

Hi David,

thanks for your answers so far. I'm working with Khaled on this project on the SuccessFactors side.

The API user has all necessary permissions and it works perfectly fine with users if we send any existing UserID for the hr field.

However, our issue occurs if we try to import users via API who do not have any HR manager. We can neither leave the field empty nor can we use the "NO_HR" term, the result is the error Khaled showed above.

We currently have 2 assumptions: Either we are using the wrong term with "NO_HR" for this case or there is a bug where the cloud integration cannot handle this term (while Postman can process "NO_HR" without any problems).

I hope this helps to clarify the current situation.

Kind regards

Matthias