I'm trying to send a variable from lwc to a screen flow. But when this variable is a Object or Array of Objects, the flow doesn't recognize and prints a empty value. I don't know what i'm doing wrong or if this is a bug.
Flow Running on API Version 59
My LWC code:
lwcFlowTest.js
import { LightningElement, api } from 'lwc';
export default class LwcFlowTest extends LightningElement {
@api
get stringVariable() {
return 'Text';
}
@api
get stringArrayVariable() {
return ['Text', 'Array'];
}
@api
get objectVariable() {
return {
LastName: 'Lead',
Company: 'Company Lead'
}
}
@api
get objectArrayVariable() {
return [
{
LastName: 'Lead',
Company: 'Company Lead'
},
{
LastName: 'Lead 2',
Company: 'Company Lead 2'
}
];
}
}
lwcFlowTest.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>58.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__FlowScreen</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__FlowScreen">
<property
name = "stringVariable"
label= "String Variable"
role = "outputOnly"
type = "String"/>
<property
name = "stringArrayVariable"
label= "String Array Variable"
role = "outputOnly"
type = "String[]"/>
<property
name = "objectVariable"
label= "Object Variable"
role = "outputOnly"
type = "@salesforce/schema/Lead"/>
<property
name = "objectArrayVariable"
label= "Object Array Variable"
role = "outputOnly"
type = "@salesforce/schema/Lead[]"/>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
the html file its empty just with
And the flow its just 2 screens, in the first the lwc is called, and in the next its printed the values.
When I run the flow, this is the output from the flow

What i'm doing wrong? or pass object or object array from lwc to flow doesn't work?



