Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Dynamically Populating Label Parameters
You can provide a string with placeholders, which are replaced by the substitution values at runtime.
Add as many parameters as you need. The parameters are numbered and are zero-based. For example, if you have three parameters, they will be named {0}, {1}, and {2}, and they will be substituted in the order they're specified.
Let's look at a custom label, $Label.mySection.myLabel, with a value of Hello {0} and {1}, where $Label is the global value provider that accesses your labels.
This expression dynamically populates the placeholder parameters with the values of the supplied attributes.
1{!format($Label.mySection.myLabel, v.attribute1, v.attribute2)}The label is automatically refreshed if one of the attribute values changes.