I would like to display a Picklist or Radio Button component inside a Visual Flow Screen with choices given by a List of values.
I have to pass these values to the Flow from within a Lightning Component, so I used the following JavaScript code in the helper to provide the correct input
controller code
creaFase : function(component,event,helper){
helper.startFlowCreaFase(component,event,component.get("v.allowedList"));
},
helper code
startFlowCreaFase : function(component,event,allowedFasi){
component.set('v.isOpen',true);
var flow=component.find('flow');
var inputVar=[
{
name : "FasiDisponibili",
type : "Picklist",
value : allowedFasi
}
];
flow.startFlow('GOAL281_CreaFaseFatturazione',inputVar);
},
where allowedList is declared in the .cmp as
<aura:attribute name="allowedList" type="String[]"/>
Inside the Flow I picked up the input by means of a Picklist variable, and then I tried to assign it to a Choice Resource in order to use it in the Screen Component, as shown in the images below
The problem is that the final result is a Picklist (or Radio Button) displaying only a single choice, corresponding to the first value of the component's attribute allowedList.
I would like to know if my approach can be fixed somehow with minor changes. Unluckily I was unable to find exhaustive explanations on how to pass a Picklist to a Flow from an Aura Component, and so I am not sure on my approach to catch up the input in the Flow neither. Any help would be greatly appreciated