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} Flow Screen showing the input variable into my LWC as {!$GlobalConstant.True}


Output when using {!$GlobalConstant.True}

However when I pass in TRUE from a formula, it works as expected

Flow UI showing the formula for input_boolean_formula

Flow Screen showing the input variable into my LWC as input_boolean_formula

Flow Screen showing the input variable into my LWC as input_boolean_formula


Output when using input_boolean_formula


    inputBoolean: {inputBoolean}<br />
    type: {typeOfBoolean}
    <hr />
    inputString: {inputString}<br />
    type: {typeOfString}


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;


<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
        <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" />
  • is it possible that the {!$GlobalConstant.True} is actually implemented as string 'true'?
    – Damecek
    Oct 6, 2021 at 7:55
  • 1
    @Damecek That's actually a really good question. I added a String attribute and the plot thickened further. The {!$GlobalConstant.True} is passed into the string as a boolean! See updated question.
    – Nick C
    Oct 6, 2021 at 12:06

3 Answers 3


Ok, so there's something funky going on with the Flow engine, and the formula approach is a bit of a red herring.

Short answer, I don't think there's anything wrong with {!$GlobalConstant.True}.

The issue is with the default value.

In my meta.xml, I had default="true" for inputBoolean, so when I added the component to the flow screen, I didn't need to set the value of inputBoolean because it was already set.

If I clear {!$GlobalConstant.True} out of inputBoolean, then add it in again, the component behaves as expected.

This would be why the formula worked; because it wasn't using the default value.

If you come across this issue, just clear the default value out of the input, and add it back again.

I've see this happen with text inputs as well.


I think I found the underlying issue; I was running into the same thing: using {!$GlobalConstant.True} as an input parameter for a LWC embedded in a flow, resulted in targetConfig property value in the LWC being undefined.

Removing the default="true" property in the LWC's metadata xml (in the targetConfig property) worked, but can't be deployed to orgs that contain flows that consume the LWC without deleting the flows.

Then I found out that if you explicitly set the inputvalue in the flow's metadata file, it works. When I retrieved the flow from a scratch org initially, the flow's xml file didn't have any value for the <inputParameters> that was defaulted for the LWC.


Add the <inputParameters> tags in the example below to your flow's xml explicitly to set the LWC's targetConfig property value, even (or especially) when the LWC has a default value for that property:


My setup:

<property name="pills" label="Pills" type="Boolean" role="inputOnly" default="true"/>

And this is how I solved this issue:

  1. remove entirely the value from screen component, Save
  2. set the value to {!$GlobalConstant.False}, Save
  3. set the value to {!$GlobalConstant.True}, Save

It is true that, when I retrieved the flow xml, I was missing the


unfortunately, I was not successful saving the flow with this update (some other issues), but after applying the steps above the flow was retrieved with this inputParameters.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .