An explainer on how to use custom
labels in the Salesforce lightning screen flow.
Custom labels are custom text values that can be accessed from Apex classes,
Visualforce pages, Lightning Pages, or Lightning components. The values can be
translated into any language Salesforce supports.
Lighting flow builder comes up with an option to include custom labels in different ways. Either you can directly add the custom label to the flow elements or create a formula field referring custom label and use it across elements of the flow.
Let us see that in action.
Use custom labels in the flow elements (example text area element)
Log
in to Salesforce > Go to Setup > Flows > Create a new Flow of type Screen
Flow
Drag and drop screen element from the left pane to the canvas
Enter the Label (1), API Name (2), and Drag & drop Display Text from the components tab to the screen element (3)
Select Display text item component (1), fill API Name (2), click on the Insert a resource input search box (3), and type or select $Label (4)
Select the custom label created (type custom label name if you don’t find it in the initial list displayed)
Click Done
Save
the changes, and run the flow.
Message
from the custom label must be shown on the flow screen at the run time.
We can also map the custom label within the Formula variable and use it across the flow. More details are below.
Go to the Manager tab within the flow builder, Click New Resource
Select Formula in the drop-down
Update API Name, select a Data type, Click on Insert a resource input box, select $Label, and select or type your custom label name
A custom label is added to the formula field, click Done.
A formula field that refers to the custom label is available. Make use of it across the flow.
Whenever there is a change in the message text from the business, we just need to update the custom label.
Wrap up
We
have covered multiple ways to use custom labels in the Salesforce
lightning screen flow. Please post your comments,
queries, and feedback in the comments section below.
In
the upcoming blog post, we will discuss how to create record types and their uses in the Salesforce Lightning CRM.
Stay connected with us by subscribing to our community
Until
then…
ALSO READ
1 Comments
Awesome Post
ReplyDelete