Text Formula Field Salesforce

In this Salesforce tutorial, we will learn how to create a formula text field in Salesforce.

Here, we discuss the steps to creating the formula for the text field in Salesforce. You have come to the right place.

Salesforce Formula Text Field

Here, we will learn how to create the formula for the text field in Salesforce Lightning.

For example, Imagine I work in a company that sells products online, and all its employees use Salesforce to manage customer data. We have the customer object for which we are using a salesforce called order that can trace the customer order within that object.

Within this customer order object, we can create a text formula field that combines the customer’s first and last name into a single full name. For this, we use the formula field, choose the text field, and enter the formula inside the field.

Here are the following steps:

1. Go to Gear icon –> Click on the Setup option –> Select the Object Manager tab that is present on the nav bar.

How to create a formula for text field in Salesforce

2. Enter the order object in the search box and then select the order object.

How to create a formula for text field in Salesforce Lightning

3.  The order object page is open. On the left side of the order object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

Create a formula for text field in Salesforce

4. Here, we want to create a new field, so we click on the new button.

Create a formula for text field in Salesforce Lightning

5. Here, we are selecting the formula data type field. The formula field type is a read-only field that derives its value from a formula expression we define. It is updated when any of the source fields change. Then click on the next button.

Salesforce create a formula field type

6. The order new custom field page is open. First, enter the field label. Here, we are filling the field label as Full Name. After that, fill in the field name, which is automatically fielded by simply clicking on the field name and clicking on the auto-adding it to the custom report type checkbox.

Salesforce Lightning create a formula for text field

7. Here, we are choosing the text field that creates a text string, for example, by concatenating another text field. Click on the next button.

How to create formula for text field in Salesforce

8. After selecting the text field, enter the formula, click the check syntax to check for errors, and click on the advanced formula subtab to use additional fields, operators, and functions. Here, we are entering the formula as First Name and the operator as Last Name.

See also  Deactivate and Remove the Global Picklist Value in Salesforce

Here we use the & operator to concatenate or combine the values of the First Name and Last Name in that field with a space in between. The double quotes are used to represent space as text. After entering the formula full name field, Click on the next button.

How to create formula for text field in Salesforce Lightning

9. Now, establish field-level security. Here, we select the profile to which we want to grant edit access to this field via field-level security. The field will be hidden from all the profiles if we do not add it to field-level security. Click on the next button.

Create formula for text field in Salesforce

10. Here, Select the page layouts that should include their fields. The field will be added as the last field in the first two-column section of these page layouts. Click on the save button

Now go to the App Launcher, click on the App Launcher, and enter the order in the search box. Select the order object. The order record page is open. To create a new order record, click on the new button, and the new order dialogue box will open. Here, we can fill in the information related to the order.

First, fill the first name and after that fill the last name and then fill the other information related to the order and after that click on the save button. After saving the record information of the order object, the record is created and shown under the order record page.

Create formula for text field in Salesforce Lightning

In this way, we understand how to change the formula for the text field in Salesforce. 

See also  How to Delete Master-Detail Relationship in Salesforce

Formula Field in Salesforce Example

#Example1

Let us imagine a company that uses Salesforce to manage its inventory. Here, we want to create a formula field that automatically generates the product code based on the Website and the product name.

Text formula field salesforce

#Example2

Here, we are managing a sales team in Salesforce, and we want to create a formula field that merges the first name and the last name of the lead object and makes a full name field that makes the easier way for the users.

Formula Field in Salesforce Example

With this, you have seen a few possibilities for using the text formula field Salesforce.

Conclusion:

I hope you read the whole article and get the complete idea related to how to create the formula for the text field in Salesforce.  I have also explained all the steps of creating the formula for the text field in Salesforce.

You may like to read