SAP Knowledge Base Article - Public

3706804 - Unable to Retrieve all Values from Picklists using Odata API

Symptom

  • Unable to retrieve all values from a picklist entity unless a specific OptionID is selected.
  • Querying all OptionIDs for a picklist entity results in incomplete data retrieval.

    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



Reproducing the Issue

  1. Attempt to query all values from a picklist entity using the OData API framework.
  2. Use the following query example:

        https:///odata/v2/PickListLabel?$filter=locale eq 'en_US' and optionId eq ''

    3. Observe that only specific OptionIDs are retrieved instead of all values for the picklist entity.

Cause

Using an incorrect query.

Resolution

  1. Use the PickListV2 entity to retrieve all values for a picklist.
  2. Refer to the SAP Help Portal guide for PickListValueV2 for detailed instructions:
    PickListValueV2 | SAP Help Portal

Example query to retrieve all values for the picklist entity `Gender`:

`https:///odata/v2/PickListV2?$filter=id eq 'Gender'&$format=json&$expand=values&$select=values/externalCode,id`

See Also

Keywords

picklist, odata api, picklist values, picklist entity, optionid, picklist retrieval, picklistvaluev2, picklistv2, odata query , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Suite 2511

Attachments

Pasted image.png
Pasted image.png