Ad Code

How to use custom labels in the salesforce lightning screen flow

Custom labels in the salesforce screen flow

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.

Create a custom label from Salesforce login > Setup > Custom labels > New

Salesforce custom label

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

Salesforce flow builder screen element

Enter the Label (1), API Name (2), and Drag & drop Display Text from the components tab to the screen element (3)

Salesforce flow builder standard component

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)

Salesforce flow display text component

Select the custom label created (type custom label name if you don’t find it in the initial list displayed)

Salesforce flow display text component

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.

Salesforce flow run time

We can also map the custom label within the Formula variable and use it across the flow. More details are below.

Use a custom label in the formula field of the screen flow

Go to the
Manager tab within the flow builder, Click New Resource

Salesforce flow builder new resource

Select Formula in the drop-down

Salesforce flow builder formula field

Update API Name, select a Data type, Click on Insert a resource input box, select $Label, and select or type your custom label name

Salesforce flow builder new formula field

A custom label is added to the formula field, click Done.

Salesforce flow builder new formula field

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…


how to create a screen flow in Salesforce lightning CRM 

Post a Comment