I'm trying to put a custom label for an exposed property of a lwc in Experience Builder.

If I have a custom label called Date, what I have to insert in Experience Builder?

<property name="labelDate" type="String" label="Filter: Date" default="{!$Label.Date}" /> 

@api labelDate;

In documentation I find this way to refer custom labels: {!$Label.Date}, but I also try {!Label.c.Date} where c is the namespace.

And in Experience Builder I try this format, but it doesn't work.

Experience builder

Is it possible do this thing? Can anyone help me? Thank you

  • have you tried default={!$Label.Date}? Feb 11, 2022 at 16:04
  • I can't: Open quote is expected for attribute "default" associated with an element type "property".
    – whynot
    Feb 11, 2022 at 16:09
  • This may not be possible directly in LWC - see the accepted answer here: salesforce.stackexchange.com/questions/317434/… Feb 11, 2022 at 16:17
  • I hope you have already imported the label in JS before using it. As explained here
    – user43598
    Feb 11, 2022 at 16:18
  • But I don't want to import the label and use it in template. I want to write in Experience Builder the custom label name (instead of a simple string) as a property. I don't know if there is a notation like visualforce (for example {!$Label.Date}) or this is not possible. So my question is: There is an expression to refer a custom label in Experience builder?
    – whynot
    Feb 11, 2022 at 16:33


You must log in to answer this question.