Remove comma from number field Salesforce

In this Salesforce Tutorial, we will learn the formula to remove commas from the number field in Salesforce. Additionally, we will go over to learn how to remove comma from number filed using Salesforce Lightning and Salesforce Classic.

While working in an organization, I got a task to remove commas from the number field using Salesforce. So, to fulfill this requirement, I define an advanced formula for this.

If you want to learn how to remove commas from the number field of Salesforce Lightning and Salesforce Classic, you have come to the right place.

The following are the topics that we will cover in this salesforce tutorial:

  • Removing comma in Number Field
  • How to remove commas from Number Field in Salesforce Lightning
  • Remove commas from Number Field in Salesforce Classic

Removing comma in Number Field

In Salesforce, numbers such as decimals, and integers are stored in numerical data types. By default, it always includes commas between the number to make the numbers easier to read.

For example, when we create a field with a Number as the data type. It always enters the number as 10,000 instead of 10000.

If we have a number field in Salesforce with commas, and we want to remove this comma from the field we can use the TEXT() function.

For example, we have a number field called Employee on the Account record that contains a value of 1,236. We want to remove this comma and want to store this value as 1236 only.

For this, we will create a Formula field called Employee No Comma that contains the formula for removing commas from the number field. Here, is a formula to remove commas from the number field.

TEXT(numberfield)

Here, we use the TEXT() function to remove the commas from the number field that we pass as the parameter. This function converts the number field value to the text field value.

With, this we have learned the formula for removing the comma from the number field in Salesforce. Now, we will move further and see How to remove commas from Number Field in Salesforce Lightning.

Read Difference between Two Datetime Fields in Salesforce

How to remove comma from Number Field in Salesforce Lightning

Here, are the steps to remove the comma from the number field in Salesforce Lightning.

Step 1: Navigate to Salesforce Setup, by clicking on the Setup icon on the upper right side of the page.

Step 2: On the left side of the menu, click on Object Manager.

Removing comma in Number Field
Removing comma in Number Field

Step 3: Search for the object to which we want to remove the comma from Number Field. Here, I select the Account object from the list of objects.

Removing comma in Number Field Salesforce
Removing comma in Number Field Salesforce

Step 4: Click on Fields & Relationships.

Step 5: Then, click on New.

Removing comma in Number Field Salesforce Example
Removing comma in Number Field Salesforce Example

Step 6: Choose the Formula as the field type.

Step 7: To continue, click Next.

How to remove comma from Number Field in Salesforce Lightning
How to remove comma from Number Field in Salesforce Lightning

Step 8: Enter a Field Label for the formula, and the Field Name will be automatically populated. Here, I enter Field Label as the Employee No Comma.

Step 9: Choose Text as the Formula Return Type. Then, click Next.

How to remove comma from Number Field in Salesforce Lightning Example
How to remove comma from Number Field in Salesforce Lightning Example

Step 10: Enter the formula in the Advance Formula editor to remove the comma from Number Field. Here, is the formula:

TEXT(NumberOfEmployees)
  • In this formula, we used the Salesforce Text() function to convert the passed number data type field NumberOfEmployees to text so that it removes the commas from the number field.

Step 11: Click Check Syntax to make sure the formula is correct.

Step 12: We can add the Description and Help Text as options, and we can also state how you want to handle the blank field.

Step 13: After that, click Next.

Remove comma from Number Field in Salesforce Lightning
Remove comma from Number Field in Salesforce Lightning

Step 14: Select the appropriate field Level Security and to make it visible to everyone, here we select the Visible checkbox.

Step 15: Select Next.

Remove comma from Number Field in Salesforce Lightning Example
Remove comma from Number Field in Salesforce Lightning Example

Step 16: Choose the Page Layout Name, for whom we want to add the formula field.

Step 17: To save the formula field, click Save.

How to remove comma from Number Field in Salesforce
How to remove comma from Number Field in Salesforce

We can use the formula field once we’ve created it. Let’s look at an example:

  • Create an Account with the Employee value field by opening the Accounts object and saving it.
  • After that, click on the Details section, and here the Employee No Comma field appears the number field without commas.
How to remove comma from Number Field in Salesforce Example
How to remove comma from Number Field in Salesforce Example

As a result, we now know how to use Salesforce Lightning’s advanced formula to remove commas from Number Field. Next, we’ll look at how to use Salesforce Classic’s advance formula to remove commas from Number Field.

How to remove comma from Number Field in Salesforce Classic

Here, are the steps to remove the comma from the number field in Salesforce Classic.

Step 1: From the Salesforce Lightning to open your Salesforce Classic edition. Click on Avtar and click Switch to Salesforce Classic.

How to remove comma from Number Field in Salesforce Classic
How to remove the comma from Number Field in Salesforce Classic

Step 2: Click on the Setup option.

How to remove comma from Number Field in Salesforce Classic Example
Remove the comma from Number Field in Salesforce Classic Example

Step 3: Scroll down to the Build section. Then under Customize, select the object for whom we want to remove the comma from the number field. Here, I choose the Products from the object list.

Step 4: Click on the dropdown menu and select Fields.

Remove comma from Number Field in Salesforce Classic
Remove comma from Number Field in Salesforce Classic

Step 5: As you scroll down the page, click on the New button under Custom Fields & Relationships.

Remove comma from Number Field in Salesforce Classic Example
Remove comma from Number Field in Salesforce Classic Example

Step 6: Select the Formula as the field type.

Step 7: Click Next to proceed.

Removing comma from Number Field in Salesforce Classic
Removing comma from Number Field in Salesforce Classic

Step 8: Enter a Field Label for the formula, and the Field Name will be automatically populated. Here, I enter Field Label as the Product Number Without Comma.

Step 9: Choose Number as the Formula Return Type and then click Next.

Removing comma from Number Field in Salesforce Classic Example
Removing comma from Number Field in Salesforce Classic Example

Step 10: Enter the formula in the Advance Formula editor to remove the comma from Number Field. Here, is the formula:

TEXT(Product_Number__c)
  • In this formula, we used the Salesforce Text() function to convert the passed number data type custom field Product_Number__c to text so that it removes the commas from the number field.

Step 11: To verify that the formula is valid, click Check Syntax.

Step 12: We can specify how you want to handle the empty field and include the Description and Help Text optionally.

Step 13: Then, click Next.

Salesforce Classic remove comma from number field
Salesforce Classic remove comma from number field

Step 14: Choose the appropriate Field’s Level Security, and then check the box Visible to make it visible to all.

Step 15: Click Next.

Advance formula remove comma from Number Field in Salesforce Classic
Advance formula remove comma from Number Field in Salesforce Classic

Step 16: Choose the Page Layout Name, for whom we want to add the formula field.

Step 17: To save the formula field, click Save.

Salesforce classic remove comma from Number Field example
Salesforce classic remove comma from Number Field example

Once we’ve defined the formula field, we may use it. Let’s explore an example:

  • Create a new product with the Product Number field value by opening the products object and saving it.
  • In the details section, we will get the Product Number without comma field in which the comma from Number Field is removed.
Advance Formula remove comma from Number Field in Salesforce Classic Example
Advance Formula remove comma from Number Field in Salesforce Classic Example

In a conclusion, we now understand how to remove the comma from the number field using Salesforce Classic’s advanced formula.

Conclusion

In conclusion, we learned the advanced salesforce formula to remove the commas from the number field in Salesforce.

Moreover, we have learned that both Salesforce Classic and Salesforce Lightning provide a simple procedure for removing the commas from the number field.

In addition to this, the following are the topics that we have discussed:

  • Removing comma in Number Field
  • How to remove comma from Number Field in Salesforce Lightning
  • How to remove comma from Number Field in Salesforce Classic

Also, Read