Big Idea or Enduring Question:
There is a formula function called BR() that allows us to insert a line break into text formula expressions or string of text, As shown in the following screenshot:
The expected result in the formula field is:
LastName
FirstName
But you will get the actual result similar to the following line because of the known issue (https://success.salesforce.com/issues_view?id=a1p300000008YkZAAU)
LastName_BR_ENCODED_FirstName_BR_ENCODED_
Objectives:
After reading this blog post, the reader will be able to:
- How to write a formula in process builder to add a line break
Business Use Case
Pamela Kline is working as a System administrator at Universal Containers (UC). She wants to update the Lead’s Description field with Lead’s Last Name in the next line of Lead’s First Name.
Automation Champion Approach (I-do):
Let’s begin building this automation process.
Guided Practice (We-do):
There are 5 steps to solve Pamela’s business requirement using Lightning Flow. We must:
- Creating a custom label to store (-)
- Define process properties
- Define evaluation criteria
- Define process criteria
- Add action – update records
Step 1: Creating a Custom Label
- Click Setup.
- In the User Interface, type Custom Labels.
- Clicks on the New Custom Label button.
- Enter Short Description the Name will auto-populate.
- Now enter the — in the Value.
- Click Save.
Step 2: Define Process Properties
- Click Setup.
- In the Quick Find box, type Process Builder.
- Select Process Builder, then click New.
- Name the Process and click the Tab button. The API Name will populate.
- As a best practice, always input a description.
- The process starts when A record changes.
- Click Save.
Step 3: Define Evaluation Criteria
- Click on the Add Object node to begin selecting the evaluation criteria.
- Select the Lead object from the dropdown list.
- Start the process when a record is created or edited.
- Click Save.
Step 4: Define Process Criteria
- Click the Add Criteria node to begin defining the process criteria.
- Name the criteria.
- The criteria should execute actions when the No Criteria – just execute the actions!.
- Click Save.
Step 5: Add Action – Update Records
- Below Immediate Actions, click Add Action.
- For Action Type, select Update Records.
- Name the action.
- Select the option Select the Lead that started your process record type.
- The criteria for updating records should be No criteria – just update the records!
- Set new field values for the records you update:
- Row 1:
- Field: Description
- Type: Formula
- Value: [Lead].FirstName &
SUBSTITUTE($Label.NewLine, “-“,””)&
[Lead].LastName
- Row 1:
- Click Save.
Almost there! Once everything looks good, click the Activate button.
Don’t forget to active the Process by clicking on the Activate button.
Proof of concept
Now onwards, if a business user updates the Lead, Process Builder will automatically populate the description with First Name and Last Name field.
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.