In this Salesforce tutorial, we will learn how to create a text encrypted field type in Salesforce and we can use it to encrypt the information because encrypted information is sensitive information that we don’t want everyone to see. Moreover, we will focus on some of the practical scenarios for implementation.
Recently, I worked for the Freddie Mac company in the United States of America. While working here, I got a task where I needed to encrypt the information. To fulfill this requirement I use the text encrypted Field Type and which is present under the Field and Relationship.
So, as a solution, I discovered the text encrypted field as a solution that helps in encrypting the information which is sensitive. Let’s go into more detail about how to create the text-encrypted field type in Salesforce Lightning and Salesforce Classic.
Text Encrypted field type in Salesforce
The text encrypted field type is defined as a field type that is work as a cybersecurity functionality that permits us to visor data. The user cannot able to visible the data without suitable permission when our data is used the field encryption.
This text-encrypted field is the field that permits the users to reserve the sensitive data in the text-encrypted form and the mask is applied to the data when the data is shown. The other user cannot show this sensitive data without the appropriate permission.
For example, if A person has an account in a bank, there is a lot of encrypted information is sensitive information that we don’t want everyone to see. To make this more encrypted we can use the text encrypted field for that information from which the other user can not see this sensitive information without the appropriate permission of the account holder. For making the information protective this text-encrypted field is very helpful and useful.
Now, let’s move further and see how to create the text encrypted field type in Salesforce Lightning and Salesforce Classic.
Read Salesforce URL Field Type is Required
How to create a text encrypted field type in Salesforce Lightning
Here we are creating the text encrypted field type in Salesforce Lightning. Here we are taking an example we are using the account object inside the account object we want to add the credit card number as a text encrypted field because the credit card number has sensitive information and the account holder did not want that any other user can see their credit card number.
This text encrypted field is the field that permits the users to reserve the sensitive data in the text encrypted form and the mask is applied to the data when the data is shown.
If you want to learn how to create the text encrypted field type in salesforce lightning follow these steps:
Step-1: Login into your Salesforce lightning account, Go to the gear icon. Under the gear icon, there are two options present first one is Setup and another one is Service Setup. Here we are clicking on the Setup option.
After clicking on the setup option, the setup page is open. Click on the Object Manager that is present at the nav bar near the home tab.

Step-2: After clicking on the Object Manager, the Object Manager page is open. Here we can see lots of objects are present. Here we want to select the account object. For selecting the account object, enter the account object in the search box. The account object is come at the top, click on the account object.

Step-3: After clicking on the account object, the account object page is open. Under this account object page, there is a details section in which field and relationship option is present. Click on the fields and relationship option.

Step-4: After clicking on the field and relationship option, the field and relationships page is open. For creating the field type click on the new button that is present at the top of the field and relationship page.

Step-5: After clicking on the new button, the data type page is open. There are lots of data types present on the page. Here we are selecting the text encrypted data type field that is present at the bottom of the page. The text encrypted field allows users to enter any combination of letters and numbers and store them in encrypted form and then click on the next button.

Step-6: After clicking on the next button, the account new custom field page is open. Now enter the details, first fill the field label as Credit Card Number and then fill the length as 20 after that fill the field name by simply clicking on the field, and the field name is automatically filled then fill the description if you want to fill otherwise leave the field the same.

Step-7: Now scroll to the bottom of the page and select the mask type here we are selecting the mask type as Credit Card Number and then selecting the mask character there are two types of mask the first one is * and the second one is X and we are selecting the * and then click on the next button.

Step-8: After entering the details, now established the field-level security. Now select the profiles to which we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security.
Click on the visible checkbox and then click on the next button that is present at the top and the bottom of the established field-level security page.

Step-9: After establishing the field-level security, now add the custom field to the page layout. Select the page layout that should include this field. This field will be added as the last field in the first 2-column section of this page layout. The field will not appear on any pages if we do not select a layout. Click on the save button.

Step-10: After clicking on the save button. The text encrypted field type is created, go to the app launcher and enter sales in the search box. Select sales, the sales page is open and then select the account object that is present in the nav bar.
The account object page is open, here you can see that on the right side of the page, there is a details section and under this section, we can see that the text encrypted field type is created and we can enter the text in the credit card number field, the mask is applied to the data when the text is shown.

In this way, we understand how to create the text encrypted field type in Salesforce Lightning. Let’s Proceed further and learn how to create the text encrypted field type in Salesforce Classic.
How to create a text encrypted field type in Salesforce Classic
Here we are creating the text encrypted field type in Salesforce Classic. Here we are taking an example we are using the account object inside the account object we want to add the national insurance number as a text encrypted field because the national insurance number has sensitive information and the account holder did not want that any other user can see their national insurance number.
If you want to learn how to create the text encrypted field type in Salesforce Classic follow these steps:
1: First log in to the Salesforce account, when we log in to the account the Salesforce lightning edition is open. Moving to Salesforce Classic, click on the Profile picture. The Profile picture drop-down list is open. Under this profile picture list, there is an option to switch to Salesforce Classic. Click on it.
After clicking on the switch to Salesforce Classic option, click on the drop-down arrow of the username. The drop-down list is open, under this list Setup option is present below the My Profile option. Click on the Setup.

2: After clicking on the setup option, the setup page is open. Enter the lead in the Quick Find Box. The account object comes at the top, click on the account drop-down menu. The drop-down list is open, under this drop-down list there is a field option. Click on the field option.

3: After clicking on the fields option, the account custom field page is open. Scroll to the bottom of the page there is an account custom field and a relationship section. For creating the new field click on the new button.

4: After clicking on the new button, the data type page is open. There are lots of data types present on the page. Here we are selecting the text encrypted data type field that is present at the bottom of the page. Click on the next button.

5: After clicking on the next button, the account new custom field page is open. Now enter the details, first fill the field label as National Insurance Number and then fill the length as 20 after that fill the field name by simply clicking on the field, and the field name is automatically filled then fill the description if you want to fill otherwise leave the field the same.

6: Now scroll to the bottom of the page and select the mask type here we are selecting the mask type as National Insurance Number and then selecting the mask character there are two types of mask the first one is * and the second one is X and we are selecting the X and then click on the next button.

7: After entering the details, now established the field-level security. Now select the profiles to which we want to grant edit access to this field via field-level security. The field will be hidden from all profiles if we do not add to it field-level security.
Click on the visible checkbox and then click on the next button that is present at the top and the bottom of the established field-level security page.

8: After establishing the field-level security, now add the custom field to the page layout. Select the page layout that should include this field. This field will be added as the last field in the first 2-column section of this page layout. The field will not appear on any pages if we do not select a layout. Click on the save button.

9: After clicking on the save button. The text encrypted field type is created, Click on the account object that is present in the nav bar.
The account object page is open, here you can see that on the right side of the page, there is a details section and under this section, we can see that the text encrypted field type is created and we can enter the text in the National Insurance number field, the mask is applied to the data when the text is shown.

So, with this, we have learned how to create the text encrypted field type in Salesforce Classic.
Conclusion
The text encrypted field is the field that permits the users to reserve the sensitive data in the text encrypted form and the mask is applied to the data when the data is shown. The other user cannot show this sensitive data without the appropriate permission.
I hope you got an idea of the text encrypted field type in Salesforce also, I have explained step by step how to create the text-encrypted field type in Salesforce Lightning and in Salesforce Classic.
You may like the following Salesforce tutorials:
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.