Symptom
When using OData API to import data for PickListValueV2 entity, you try to update the value of Parent Picklist by providing label for field "parentPickListValue".
The API response is successful, but in the UI you find the parent picklist is not the expected one.
"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 HCM Suite
- PickListValueV2 Odata API Entity
Reproducing the Issue
Upsert PickListValueV2 entity, and specify field "parentPickListValue" with label "123".
eg. https://apisalesdemo8.successfactors.com/odata/v2/upsert?$format=json
Payload:
{
"__metadata": {
"uri": "PickListValueV2",
"type": "SFOData.PickListValueV2"
},
"externalCode": "1",
"PickListV2_effectiveStartDate": "/Date(-2208988800000)/",
"PickListV2_id": "ABC",
"parentPickListValue": "123"
}
The response of this request is successful, but the expected parent picklist is not displayed in UI.
Actually the one written is from another picklist, and it has duplicate label "123".
Cause
When you provide "label" for the field "parentPicklistValue", the internal SF importing logic would find the target picklist according to the label only.
If there are two or more picklists with duplicate labels, it may pick a different picklist than you expect.
As a result, the API request may write a wrong parent picklist with the same label, even if it's not from the configured Parent Picklist.
Resolution
To ensure to import the expected picklist, you can use inline structure and specify the correct parent picklist with "parentPickListValueNav".
Refer to the below sample payload. Please specify all the business keys of the parent picklist.
{
"__metadata": {
"uri": "PickListValueV2",
"type": "SFOData.PickListValueV2"
},
"externalCode": "1",
"PickListV2_effectiveStartDate": "/Date(-2208988800000)/",
"PickListV2_id": "ABC",
"parentPickListValueNav": {
"__metadata": {
"uri": "PickListValueV2(PickListV2_effectiveStartDate=datetime'1900-01-01T00:00:00',PickListV2_id='XYZ',externalCode='123')",
"type": "SFOData.PickListValueV2"
}
}
}
Keywords
PickListValueV2, Cascading Picklist, Parent, Child, parentPickListValueNav , KBA , LOD-SF-INT-MDF , Metadata Framework API (MDF) , Problem