Symptom
While attempting to upsert an existing record in a Background entity - You only enter the values for the fields you wish to change.
- But this results in the rest of the fields becoming null.
"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) GET: https://apisalesdemo2.successfactors.eu/odata/v2/Background_OutsideWorkExperience?$filter=userId eq 'XXXX'&$format=json
employerEmail: null
2) POST: https://apisalesdemo2.successfactors.eu/odata/v2/upsert?
{
"__metadata": {
"uri": "Background_OutsideWorkExperience"
},
"backgroundElementId": "XXX",
"userId": "XXX",
"employerCountry": "XXX",
"employerAddress": "XXX",
"endDate": "/Date(XXX)/",
"employerZip": "XXX",
"employerState": null,
"employerCity": null,
"startTitle": "XXX",
"employerEmail": "TEST_BG_OVERWRITE",
"bgOrderPos": "1",
"employer": "XXX",
"businessType": "XXX",
"employerContact": null,
"employerPhone": "XXX",
"startDate": "/Date(XXX)/",
"presentEmployer": "XXX"
}
3) Re-run the GET to confirm it's populated
4) The re-run same POST request without employerEmail in the payload
5) Run the GET again & you will see employerEmail is set to null
Cause
The system updates all fields for an existing background record, and it considers the non specified fields to be null on purpose.
Resolution
If you wish to keep the original values for these fields, you need to specify the fields as their original value.
Keywords