BR() Function in Salesforce | How to Break Line in Salesforce : Bijay Kumar
by: Bijay Kumar
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of the Content The content discusses the use of the BR() function in Salesforce, which is a text function that allows users to insert line breaks in string formulas. This is particularly useful for formatting contract details or other text outputs in a clear and organized manner. **Key Details:** - The BR() function inserts an HTML break tag in Salesforce string formulas. - It should be used with concatenation operators (& or +) and is not applicable in mail merge templates, S-controls, and reports. - The syntax for the BR() function is simply `BR()`, with no parameters. - A practical example shows how to use the BR() function to format campaign details, including the campaign name, start date, and end date, each on a new line. - The tutorial provides step-by-step instructions on how to implement the BR() function in Salesforce Lightning, including creating a formula field and setting field-level security. ### Additional Context Understanding how to use the BR() function can significantly enhance the readability of outputs in Salesforce, making it easier for users to digest information. This function is particularly beneficial for system administrators and developers who need to present data clearly in reports or user interfaces. ### Hashtags for SEO #Salesforce #BRFunction #SalesforceTutorial #LineBreaks #SalesforceLightning #TextFunctions #CRM #SystemAdministrator #SalesforceTips #FormulaField #DataFormatting
While working as system administrator in an organization that uses Salesforce for customer management, I was tasked with printing basic contract details. But there is one twist: each detail must be a new line.
So, I have found that Salesforce provides a function named “BR” that inserts a new line.
In this tutorial, we will learn how to break a line using the BR() function in Salesforce. In addition, we will discuss the syntax of the BR function in Salesforce and provide some real-world business examples.
What is the BR() Function in Salesforce?
In Salesforce, the BR() function is one of the text functions used to perform text operations. This BR() function is to insert an HTML break tag in string formulas.
In addition, to this keep one thing in mind to use the & or + concatenation operators to surround the BR(). And also this function should not be used in mail merge templates, S-controls, and reports.
Below is the syntax of the BR function in Salesforce:
BR()
- Here, we don’t pass any value to the parentheses it remain blank.
Let’s look at the scenarios for a better understanding of the BR function.
As I have discussed, I got the task of printing some basic details of the contract. So, here is the function base formula based on the BR function.
"Contract Name:" & Name & BR() "Contract Term:" & ContractTerm
With this, we have learned the syntax of the BR() function with real-life based examples. Now, we will proceed and learn how to use the BR function in Salesforce Lightning.
Use the BR() Function in Salesforce
Below are the steps to use the BR function in Salesforce Lightning to break a line:
- Open Salesforce Lightning mode. Next, click the “Gear Icon” in the top right corner of the page. Click “Setup“ from the dropdown menu to continue.

- The setup page opens when you select the Setup option. Here, the “Object Manager” is found in the Navigation Bar next to the Home tab. Click on it.

- The object manager page opens when you click it. There are numerous objects seen here. Use the Quick Find search field to find the item on which we want to use the BR() function.
- Now, click the “Campaign” object to move to the lead object page.

- On the product object page, the “Field & Relationship” option is in the details section on the left. Select “Field & Relationship” from the menu.
- The field and relationships page is opened after selecting the field and relationship option. Click the “New” button at the top of the page.

- The field type page opens when you click the new button. The page contains a wide variety of field types. In this case, I chose the “Formula” field type, as I want to use the TEXT function in the advanced formula.
- Click the “Next” button to move on to the next step.

- Now, the choose output type page opens. Here, we enter the information by filling in the “Field Label” and the “Field Name” which automatically fills up as you enter the field label.
- In this example, I entered the field label as “Campaign Details”, as I want to get the important upcoming campaign details.
- Now scroll down, move to the output data type, and choose the “Output Data Type” for the field in which you want to store the resultant output. Here, I check the radio button next to the “Text” data type as I want to get the result in text format.
- Click on the “Next” button, to move to the next step.

- Move to the advanced formula editor box, move to the right side in the Functions Section, and from the dropdown choose the Text Categories Functions.
- Select the BR function from the list of text functions and enter it into the formula editor. In this example, I use the BR function to print the details of the upcoming campaign with the line break. The formula is as below:
"Campaign:" & Name & BR() & "Satrt Date:" & TEXT(StartDate) & BR() & "End Date:" & TEXT(EndDate)
- Here, we are printing the campaign details such as Name, StartDate, and EndDate with a line break in each detail.
- So, to break the line and insert the new line, we use the BR() function of Salesforce.
- We have also used the & operator to concatenate the two text values together.
- In addition, we use the TEXT() function to convert the date type to a text type field. If you do not do so it will produce an error.
- Click on the “Check Syntax” button, to verify that the formula has no errors.
- Optionally, we can define the “Description” and “Help Text” as well as “Handle the empty field” if we want.
- Click on the “Next” button to go to the next step.

- In this step, establish “Field-Level Security“. Choose the profiles to which we wish to grant field-level security edit access to this field. If field-level security is not added, the field will be hidden from all profiles.
- As I want it to be visible to all profiles, I have checked the “Visible” checkbox. After that, click the “Next” button located at the top.

- Add the custom field to the “Page Layout“ after setting up the field-level security. Pick the page layout that has this field in it. If we do not select a layout, the field will not appear on any pages.
- To save the formula field, click the “Save” button.

We can use the formula field once we have created it. Let’s look at an example:
- Open the Campaign Tab and create a new campaign with the field Name, StartDate, and EndDate.
- Move to the Detail Section, where the Campaign Details field displays the output of the BR() function.

As a result, we have learned how to use the BR function in Salesforce.
Conclusion
In conclusion, we have learned about the Salesforce BR() function. In addition, we have learned the syntax of the Salesforce BR function with multiple real-world business scenarios.
Furthermore, we have learned the procedure of the BR function in Salesforce Lightning and Salesforce Classic.
You may like to read:
The post BR() Function in Salesforce | How to Break Line in Salesforce appeared first on SalesForce FAQs.
November 27, 2025 at 06:44PM
Click here for more details...
=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment