How to Set Default Value For Text Field in Salesforce

The default value for the text field uses the default value property, which automatically occupies the text field when the user or organization creates a new record.

To set the default value for the text field using the formula. We need to enter the desired default text value. The text that we enter in the default value formula field can be as simple or as our requirement.

If you want to learn how to set the default value for the text field in Salesforce, you have come to the right place.

How to Set the Default Value for Text Field in Salesforce

Here, we will learn how to set the default value for the text field in Salesforce.

Let’s take an example related to the Lead Source default value that understands the scenario clearly.

Suppose I work in a company that uses Salesforce. The company runs an online webinar, The company member notices that most of the leads come from the same source. For this, we want to save our type so we generate an automatically occupied field with a default value.

Many of the leads come from these webinars. So, for this, we set the default value for the lead source detail fields to “Webinar” whenever a new lead is created.

Here are the following steps:

1. Login to the Salesforce account –> Go to the Gear Icon –> Click on the Setup option.

How to set the default value for the text field in Salesforce

2. Now click on the Object Manager tab that is present on the nav bar.

How to set the default value for the text field in Salesforce Lightning

3. Now enter the lead in the search box, select the lead object.

Set the default value for the text field in Salesforce

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

Set the default value for the text field in Salesforce Lightning

5. The Fields and Relationships page is open. Under this page, we can see that lots of fields are already created. But we want to create a new field, so we click on the new button.

Salesforce set the default value for the text field

6. Here, we are selecting the text data field at the bottom of the page. This field type allows users to enter any combination of letters and numbers and then click on the next button.

Salesforce Lightning set the default value for the text field

7. Now enter the details. First, fill the field label as Lead Source Details and then fill the length as 18. After that, fill the field length and then fill the field name. Click on the Next Button.

How to set default value for the text field in Salesforce

8. Here, we can see that there is a default value field where we can enter the text that produces the desired default text value for the custom object called lead. We can create the default value formula as “Webinar”. Click on the next button.

How to set default value for the text field in Salesforce Lightning

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

Set default value for the text field in Salesforce

10. 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.

Set default value for the text field in Salesforce Lightning

11. The lead field and relationships page opens. This page already contains many fields, and the field we created, lead source detail with a default value, is also present inside this fields and relationships page.

Salesforce set default value for the text field

12. Now go to the App Launcher, click on the app launcher, and enter the lead object in the search box. Selecting the lead object. The lead record page is open. Here, we want to create a new lead. To create the new lead record, click on the new button.

The new lead dialogue box opens. Here, we can fill in the information related to the lead. First, fill out the Salutation, then the first name and last name, and then click on the save button.

Salesforce Lightning set default value for the text field

13. After clicking on the save button, Mr. John Willms’s lead record is created successfully after opening the John Willms lead record. The record page is open, and under this page, we can see that under the lead source details field, the webinar value is filled by default and shown.

How to set a default value for the text field in Salesforce

In this way, we understand how to set the default value for the text field in Salesforce Lightning. 

Conclusion:

I hope you read the entire article and get a clear idea of how to set the default value of the text field in Salesforce. I have also explained all the steps of setting the default value of the text field in Salesforce.

You may like to read

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.