function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vinay Kumar VemulaVinay Kumar Vemula 

Unable to create Multi-select picklist in .design class for configuring lightning component

Hi All,

I'm unable to create Multi-select picklist in .design class in lightning component with design:attribute, Its not allowing to add datasource to that Multi-select picklist.

Error I got is: Failed to save MyComponent.design: Only String attributes may have a datasource in the design file.: Source

My code is:
MyComponent.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
    
    <aura:attribute name="MyVelues" type="String[]" />
</aura:component>
MyComponent.design
<design:component label="MyComponent">

    <design:attribute name="MyVelues" datasource="value1,value2,value3" default="value1" />
    
</design:component>
If anyone could help it would be appreciated.
Thanks,
Vinay
 
sfdcMonkey.comsfdcMonkey.com
Hi Vinay, A design resource supports only attributes of type Integer, String, or Boolean.
i think only workaround is use boolean attributes for handel multi-select options.
Thanks, let us know if it helps you 
 
Vinay Kumar VemulaVinay Kumar Vemula
Hi Piyush,
Thanks for reply. Actually I'm able to create Multi-select picklist, see below screenshots for reference. But when I'm passing datasource for that Multi-select picklist then I'm getting that error.
Please check the below link for rerference,
https://docs.releasenotes.salesforce.com/en-us/summer15/release-notes/rn_lightning_datasource_picklists.htm

here it is multi-select picklist in design source
User-added image

when I click on that select button, I'm getting this popup as well, but when I'm passing datasource then I'm getting that error.
User-added image

Thanks,
Vinay
sfdcMonkey.comsfdcMonkey.com
have you successful saved your design file with attribute type="String[]"  ?
 
Vinay Kumar VemulaVinay Kumar Vemula
Yes, I have saved successfully without datasoure. Thats why I got the above output. But when I'm trying to add datasource to that design attribute then I'm getting that error.