1

I created a component that would make a multi-select pick list on a screen flow. It works except you can't assign it to a variable that can be referenced when moving on to the create records part of our flow. I need to figure out what I am missing to assign the select values so they can be used on the multi-select picklist when creating the record.

Component

<aura:component implements="lightning:availableForFlowScreens" access="global">
<aura:attribute name="column01_label" type="String"/>
<aura:attribute name="options" type="List" access="global" default="[
    { label: 'Carpet/Resilient', value: 'Carpet/Resilient' },
    { label: 'Ceramic', value: 'Ceramic' },
    { label: 'Performance Floor', value: 'Performance Floor' },
    { label: 'Maintenance - One Time', value: 'Cleaning/Maintenance' },
    { label: 'Epoxy', value: 'Epoxy' },
    { label: 'Disinfection/Repetitive', value: 'Sanitize/Rep' }]"/>

<lightning:dualListbox name="Divisions"
                       label= "Select Divisions"
                       sourceLabel="Available"
                       selectedLabel="Selected"
                       fieldLevelHelp="Select your projects divisions"
                       options="{!v.options}"
                       onchange="{! c.handleChange }"/>

</aura:component>

Controller:

({
    handleChange: function (cmp, event) {
    // This will contain an array of the "value" attribute of the selected options
        var selectedOptionValue = event.getParam("option");
    }
});

Design:

<design:component >
  <design:attribute name="options" label="options" />
</design:component>
0

From what I can see here, you can't pass a list of SelectOptions through an aura:attribute.

Apex classes that define @AuraEnabled fields. Supported data types in an Apex class are Boolean, Integer, Long, Decimal, Double, Date, DateTime, and String. Single values as well as Lists are supported for each data type.

Your best bet might be to create a JSON string or some other single string made up of the values that you are trying to pass - and parse that into your options list in the Aura component.

I'm not sure exactly how you are passing the options list to the component, so I can't give you a definitive way of doing that here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.