Convert Text to Number Field in Salesforce

In this Salesforce tutorial, we will learn how to convert the text to number field type in Salesforce.

If you want to learn how to convert text to a number field type in Salesforce, you have come to the right place.

How to Convert Text to Number Field in Salesforce

Here, we will learn how to convert the text to a number field type in Salesforce.

For example, there is a University that uses Salesforce to manage student records and includes a custom object for course enrollment. This object contains custom text fields, and inside many fields, there is a grade text field where the instructor enters the student grades as text values like A, A+, B, B+, etc.

But now the university wants to convert the grade text field into a number field to perform the CGPA calculations and for this, they can easily generate reports.

Here are the following steps:

1. Login into Salesforce, click on the gear icon, select the Setup option.

    How to convert the text to number field type in Salesforce

    2. Here, we click on the object manager tab that is present on the nav bar.

    How to convert the text to number field type in Salesforce Lightning

    3. Enter the course enrollment in the search box and select the course enrollment object.

    Convert the text to number field type in Salesforce

    4. The course enrollment object page is open. On the left side, we can see the Fields and Relationships option. Click on the Fields & Relationship option.

    Convert the text to number field type in Salesforce Lightning

    5. Here, we are selecting the text field as a grade. This grade field change text to number data type.

    Salesforce convert the text to number field type

    6. The course enrollment custom field grade page is open. Click on the edit button.

    Salesforce Lightning convert the text to number field type

    7. Now, we convert the grade text field type to a number field type to perform the CGPA calculations, and for this, they can easily generate reports. For changing the field click on the change field type button.

    How to convert text to number field type in Salesforce

    8. Here, we can see that the text field type is already selected, but we want to convert this text field to a number field. Click on the number checkbox.

    How to convert text to number field type in Salesforce Lightning

    9. After clicking on the number field type, the pop-up message comes up as we can see at the top of the page. The message is Changing to the selected datatype will cause you to lose all the existing data in this field, Read the message carefully and click on the ok button.

    Convert text to number field type in Salesforce

    10. Now our text field type is converted to a number field type that allows the users to enter any number, leading zeros are removed, and then click on the next button.

    Convert text to number field type in Salesforce Lightning

    11. Now we can enter the details related to the custom field grade, and here we can enter the length of the number and the number of decimal places a number with a length of 8 and 2 decimal places can accept values up to 12345678.90 and then click on the save button.

    Salesforce convert text to number field type

    12. Our grade text field is converted to a number field and seen under the field and relationships page.

    Salesforce Lightning convert text to number field type

    13. Go to the App Launcher and enter the Course Enrollment object in the search box. Click on the course enrollment; the course enrollment page is open. We can see there is no record present on this page.

    See also  Salesforce Email Field

    To create a new record, click on the new button. Enter the complete information related to the course enrollment. First, fill in the course enrollment name here, fill in the computer course, and then enter the grade as 8, and then click on the save button.

    How to convert a text to number field type in Salesforce

    14. The computer course record page is open. We can see the details related to the computer course, and our grade field is converted into a number field.

    How to convert a text to number field type in Salesforce Lightning

    In this way, we understand how to convert the text to number field type in Salesforce Lightning.

    Conclusion:

    I hope you read the complete article and get the complete idea related to how to convert the text to a number field type in Salesforce.

    You may like to read