Im new here. I'm working on modifying a Lightning Web Component (LWC) that is used within a Salesforce Flow screen. I've added a checkbox input to the LWC, and my goal is to pass the value of that checkbox (true or false) to a Flow variable.
I've set up the checkbox in the LWC and exposed its value using a public @api property. However, when I run the Flow in debug mode, the Flow variable that should receive the checkbox value is always null, no matter if the checkbox is checked or unchecked by the user.
How can I ensure the checkbox value is properly passed from the LWC to the Flow variable during execution? I'm looking for guidance on what I might be missing — whether it's in the LWC code, the metadata config, or how the Flow variable binding is set up. HTML
<lightning-input type="checkbox" label="PO number is required" checked={isPoRequired} onchange={handlePoRequiredChange}></lightning-input>
JS
@api isPoRequired;
isPoRequired = true;
handlePoRequiredChange(event){
this.isPoRequired = event.target.checked;
}
XML
<property name= "isPoRequired" label="PO is required checkbox" type="Boolean" />