Symptom
- How to sort the Display Order of an MDF picklist?
- How to sort the MDF picklist values Alphabetically?
- How to use the custom sort order for MDF picklist?
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
- Metadata framework (MDF)
Reproducing the Issue
- Create an MDF Picklist with few values in it.
- Create an MDF object and configure a Picklist type field and map your picklist in that field. (using Valid Value Source property)
- Try to create data for your MDF object and click on picklist field drop-down.
- You notice that the order of the picklist values is not the way you expected. The values are not in the same order as they appear in Picklist Center page.
Cause
You can control the order of Picklist in "Display Order" under Picklist Center. By default Picklist values are sorted Alphabetically on the basis of Labels. See example below:
Setting:
Result: The order followed is Alphabetical. i.e Four => One => Three => Two. (see screenshot below)
Notice that the externalCode (T1, T2...) of the picklist value does not matter here. They are sorted on the basis of Labels.
Resolution
If you want the values to be sorted in some other way, you have other options in Property "Display Order"
- Go to Picklist Center
- Select a Picklist
- Click on "Edit"
- Select the display order
- After the change click on "Save"
We have 3 options here and we will see how we can use them one by one
1) Alphabetical => Picklists follow this order by default. The result will be same as explained above.
2) Numeric => Use Numeric order in case Labels are of Numeric type. Like Age: which has to be a number. In this case, the Labels will have to be strictly Numeric. Again the exteranlCode value does not matter at all here. It just has to be unique for every value.
So once you have such numerical values and choose Display order = "Numeric", the values will be sorted numerically (starting from lowest number on the top ---> higher number at the bottom of the Picklist). See below:
Result: The order followed is Numeric. i.e 1 => 2 => 3 => 4
3) Custom => For this, you have to provide a number in the "Sort Order" field of each picklist value. This Sort Order number will define which value appears at which position in the dropdown. It can be very helpful in case you want to see certain most selected values always on the top.
So once you have set the display order to Custom, click on the value and enter a numeric value in the Sort Order field for all the picklist values. See below:
Setting:
Result: The order followed is Custom. i.e One (T3) > Two (T4) > Three (T2) > Four (T1)
NOTE:
This is only for picklist values ordering. The ordering of instances of an MDF object on Manage data or the order of the values in GO type field is not possible.
The picklist field is displayed in order, with the exception that "Business" is always displayed first, and the other types are displayed in order.
See Also
Keywords
custom sort order, alphabetical, alphabetically, picklist order, picklist values order, sorrting, order, numeric, numerically, display order, order, MDF Picklist , KBA , LOD-SF-MDF-PKL , Picklists , How To