Activity Forums Salesforce® Discussions How to use custom label inside the Salesforce component?

  • Tanu

    Member
    September 20, 2016 at 9:31 am

    Hello Mohit,

    Use this syntax to access custom labels in Lightning components:

    • $Label.c.labelName for the default namespace
    • $Label.namespace.labelName if your org has a namespace, or to access a label in a managed package

    Here are some examples.

    1. Label in a markup expression using the default namespace
      {!$Label.c.labelName}
    2. Label in JavaScript code if your org has a namespace
      $A.get("$Label.namespace.labelName")

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos