+ Start a Discussion
Lucky A 8Lucky A 8 

Is there a way I could display multi-select picklist values in different columns in a lightning component?

User-added imageThank You
Raj VakatiRaj Vakati
You can able to do it like this 
  • Use Dynamic apex to get the picklist values from the table 
  • Return the values as Set of String in apex controller 
  • Use aura:iteration in component and show earch value as check list 
  • While saving them save the values as comma separted to fields 
public class multiPicklistCtrl {
    public static List < String > getselectOptions(sObject objObject, string fld) {
        system.debug('objObject --->' + objObject);
        system.debug('fld --->' + fld);
        List < String > allOpts = new list < String > ();
        // Get the object type of the SObject.
        Schema.sObjectType objType = objObject.getSObjectType();
        // Describe the SObject using its object type.
        Schema.DescribeSObjectResult objDescribe = objType.getDescribe();
        // Get a map of fields for the SObject
        map < String, Schema.SObjectField > fieldMap = objDescribe.fields.getMap();
        // Get the list of picklist values for this field.
        list < Schema.PicklistEntry > values =
        // Add these values to the selectoption list.
        for (Schema.PicklistEntry a: values) {
        system.debug('allOpts ---->' + allOpts);
        return allOpts;

Lucky A 8Lucky A 8
Hi Raj,

Thanks for your response. My concern right now is not just displaying picklist values in a lightning component, but it is displaying the picklist values in 4 different columns. Lets say I have 20 picklist values and I want them to be displayed in 4 different columns with 5 values in each column as shown in the file above.