Is there a known issue with passing in the {!$GlobalConstant.True} into an LWC FSC?
When I pass {!$GlobalConstant.True} into a Boolean attribute on an LWC, the LWC doesn't receive anything. The variable is undefined.
When I pass {!$GlobalConstant.True} into a String attribute on an LWC, the LWC receives it as a boolean
Am I doing something wrong? Or is this a problem with the flow/lwc interaction.
See below for the setup of the LWC in flow, then the code for the LWC. As you can see, it's a really basic LWC, so can't see how there could be a problem with it.
Flow Screen showing the input variable into my LWC as {!$GlobalConstant.True}
Output:
However when I pass in TRUE from a formula, it works as expected
Flow Screen showing the input variable into my LWC as input_boolean_formula
Output:
inputBooleanExample.html
<template>
inputBoolean: {inputBoolean}<br />
type: {typeOfBoolean}
<hr />
inputString: {inputString}<br />
type: {typeOfString}
</template>
inputBooleanExample.js
import { LightningElement, api } from 'lwc';
export default class InputBooleanExample extends LightningElement {
@api inputBoolean;
@api inputString;
get typeOfBoolean() {
return typeof this.inputBoolean;
}
get typeOfString() {
return typeof this.inputString;
}
}
inputBooleanExample.js-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__FlowScreen</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__FlowScreen">
<property name="inputBoolean" label="Input Boolean" type="Boolean" default="true" role="inputOnly" />
<property name="inputString" label="Input String" type="String" default="true" role="inputOnly" />
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
{!$GlobalConstant.True}
is actually implemented as string'true'
?solution
:D