How to Change Text Field to Lookup Field in Salesforce

In this Salesforce tutorial, we will learn how to change the text field to the lookup field in Salesforce. Let’s take an example from which we can easily understand the scenario related to changing the text field to the lookup field in Salesforce, There is a university that is based in the United States of America, Suppose I am working in this university that uses the Salesforce for managing the Student information and Course Enrollment.

Originally we had a custom object called Student Enrollements that could trace which courses every student was enrolled in. In this course enrollment custom object, we had a text field called course name and inside this field, the staff member of the university manually entered the name of the student courses that the student was taking.

Still, as the university grew and added more courses inside the course name and offered all these courses to students the university staff decided to change the course name text field of the student enrollment object into the lookup field that links to the courses object and all the available courses name information are stored inside the courses.

If you want to learn the process of how to change the text field to lookup field in Salesforce you have come to the right place and we learn this topic in both the editions of Salesforce Lightning and Salesforce Classic.

How to Change a text field to lookup field in Salesforce Lightning

Here we will learn how to change a text field to a lookup field in Salesforce Lightning. Suppose I am working in a company as an employee that sells a product to customers and all the company members use the salesforce to manage the customer data. Originally the company team had a custom object called an order that could trace the customer’s order. There is a Product name text field of the order object where all the sales representatives manually enter the name of the product order.

Although the company business grew all the heads of the company realized that we needed a more organised way to control the products and make sure the data accuracy. That is why the team of company decided to change the product name text field of the order object into the lookup field that links to the product object and can store all the information related to all the available products.

If you want to learn how to change the text field to the lookup field in Salesforce Lightning, follow these steps:

In Salesforce we cannot directly convert the text field into the lookup field. A lookup field in Salesforce lookup field is a particular type of field that permits the user to create a relationship between the two objects and the text field is used to store the plain text.

Step-1: First Login into the Salesforce account and we log into the Salesforce account by entering the username and password. We directly log in to the Salesforce account our Salesforce Lightning version is open. Here we can change the text field to the lookup field in Salesforce.

Under this gear icon, After clicking on the gear icon that is present at the top right corner. we can see that two options are present, the first one is setup and the other one is Service Setup. Here we are clicking on the Setup option.

How to Change a text field to lookup field in Salesforce

Step-2: After clicking on the setup option the Setup page is open, under this setup page we can see that two tabs are present on the nav bar. Here we are selecting the object manager tab for choosing the object.

How to Change a text field to lookup field in Salesforce Lightning

Step-3: The Object Manager page opens, After clicking on the Object Manager tab. Under this object manager tab, lots of objects are present.

Select one of the objects from the lots of objects If the object is not shown you want to choose from all of these objects then you can enter the object name in the search box and this search box is present at the top right corner of the page.

And here we are entering the product in the search box. The product object comes at the top and select the product object from the object manager page.

Change a text field to lookup field in Salesforce

Step-4: The product object page is open, After clicking on the product object, under this page, we can see the details related to the object. And on the left side of the product object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

Change a text field to lookup field in Salesforce Lightning

Step-5: After clicking on the field and relationship option, we can see that the field and relationship page is open and under this page, we can see lots of field are present that is already created. Here we can see there is one field called product name that is a text field type and this text field is used to store the plain text.

Salesforce Change a text field to lookup field

Step-6: Again clicking on the Object Manager tab, The Object Manager page opens. Under this object manager tab, lots of objects are present.

Select one of the objects from the lots of objects If the object is not shown you want to choose to enter the object name in the search box and this search box is present at the top right corner of the page.

And here we are entering the order in the search box. The order object is already present at the first number, if the object is not present at the top after searching the object comes at the top we search in the search box, and select the order object from the object manager page.

Salesforce Lightning Change a text field to lookup field

Step-7: The order object page is open, After clicking on the order object, under this page, we can see the details related to the object. And on the left side of the order object page, we can see the Fields and Relationships option. Click on the Fields and Relationship option.

How to Change text field to lookup field in Salesforce

Step-8: After clicking on the field and relationship option the field and relationship page is open. Here we can see lots of field are present that is already created but we want to create a new lookup field for this we click on the new button.

How to Change text field to lookup field in Salesforce Lightning

Step-9: After clicking on the new button, the data type page is open. Here we can see lots of data types are present, select one of the datatypes, and here we are selecting the lookup data type that created a relationship that links this object to another object.

The relationship field allows the user to click on the lookup icon to select the value from a popup list. After selecting the data type click on the next button.

Change text field to lookup field in Salesforce

Step-10: After choosing the field choose the related object. Select the other object to which this object is related and here we are selecting the product object from all the related to options and then click on the next button.

Change text field to lookup field in Salesforce Lightning

Step-11: Here we are entering the label and name for the lookup field and here we are entering the field label as Product name and the field name which is automatically fielded by simply clicking on the field name and then clicking on the next button.

Salesforce Change text field to lookup field

Step-12: The next step is to establish field-level security, After clicking on the next button. 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.

Here we want to select all the field-level security for the profile so we click on the visible checkbox all the checkboxes are checked and then click on the next button.

How to Change the text field to lookup field in Salesforce

Step-13: After establishing the field level security, now we can add a reference field to the page layout by selecting the page layout that should involve this field.

The field will be added as the last field in the first two-column section of these page layouts. The field will not appear on any pages if we do not select a layout. After that click on the next button.

How to Change the text field to lookup field in Salesforce Lightning

Step-14: Now add the custom related list, specify the title that the related list will have in all of the layouts associated with the parent, and then select the page layout that should involve this field. After that click on the save button that is present at the top and the bottom of the page.

Change the text field to lookup field in Salesforce

Step-15: Now go to the App Launcher, click on the app launcher, and enter the sales in the search box. The sales come at the top, click on the sales option. After clicking on the Sales, the Sales page is open. Under this Sales page, there are lots of objects present on the nav bar and we are selecting one of the objects. Here we are selecting the product object.

After clicking on the product object, the product page is opened. Under this page, the record is saved. Here we want to create a new order, To create the new product record click on the new button that is present in the right top corner. After clicking on the new button, the new product dialogue box is open. Here we can fill the information related to the order.

Fill the product name here product field is a text field type here we can store the plain text and click on the save button.

Change the text field to lookup field in Salesforce Lightning

Step-16: Now click on the order object, and the order page is opened. Under this page, the record is saved. Here we want to create a new order, To create the new order record click on the new button that is present in the right top corner. After clicking on the new button, the new order dialogue box opens.

Here we can fill the information related to the order. Here you can see that there is the product name field. After clicking on this field the drop-down menu is open. From this drop-down menu select the value and product name is filled and then click on the save button.

Salesforce change the text field to lookup field

Here you can see that the product object has a product name field of text field type. Then we create a lookup field on the order object with the same name as the product object.

And this lookup field creates a relationship between these objects our order field works as a child relationship name and the product field work as the parent relationship and we can see that our text field is converted into a lookup field with the help of this method.

In this way, we understand how to change the text field to the lookup field in Salesforce Lightning. Let’s Proceed further and learn how to change the text field to the lookup field in Salesforce Classic.

Read How to Set Default Value For Phone Number Field in Salesforce

How to Change a text field to lookup field in Salesforce Classic

Here we will learn how to change a text field to a lookup field in Salesforce Classic. For example, Suppose I am working in an agency like real estate that uses the salesforce to manage all the things related to properties. In the salesforce, there is an object called property listing that is used to trace the properties and under this object, we have a listen agen text field where we can easily enter the name of the responsible agent for every property listing.

As the agency of real states grows day by day we want to better trace and manage the agent information and all the members of the real state agency decided to change the listing agent text field of the property listing object into the lookup field that links to a new custom object and this new custom object name is known as an agent.

As we know we can’t directly convert the text field into a lookup field. The lookup field in Salesforce is a specific type of field that allows the user to build a relationship between the two objects and the text field is used to contain the plain text.

If you want to learn how to change the text field to the lookup field in Salesforce Classic follow these steps:

Step-1: When we log into the Salesforce account, the Salesforce lightning version is open directly but now we want to work on Salesforce Classic.

So we need to switch to Salesforce Classic. To switch to Salesforce Classic click on the profile picture, The Profile picture drop-down menu is open, under this drop-down menu, there is an option to switch to the Salesforce Classic edition.

Click on the switch to the Salesforce Classic edition. Our Salesforce Classic org is open. Here we can see that the username is present. Click on the drop-down arrow of the username. After clicking on the drop-down arrow the drop-down list is open. Under this drop-down list, we can see that the Setup option is present. Select the Setup option.

How to Change a text field to lookup field in Salesforce Classic

Step-2: The setup page is open, After clicking on the setup option. Enter the object in the Quick Find Box. The object comes at the top that is present under the create, click on the object option.

Change a text field to lookup field in Salesforce Classic

Step-3: After clicking on the object, the objects page is open and under this page, we can see that lots of objects are present and we want to select one of the objects from all these objects. Here we are selecting the property object from all of the objects.

Salesforce Classic Change a text field to lookup field

Step-4: After clicking on the property object, the property object page is open. On this page detail related to the property is present.

After that scroll to the bottom of the page we can see that there is a custom field and a relationship section is present under this section there are lots of field are present that is already created. From all these fields we can see that there is a property agent field with text data type also present.

Now we want to change this text field into the lookup field. So for this, we link this field with the agent object.

How to Change text field to lookup field in Salesforce Classic

Step-5: Now again click on the objects, the custom objects page is open. Under this custom objects page, lots of objects are present and here we are selecting one object from all of these. Here we are selecting the agent object. Click on the agent object.

Change text field to lookup field in Salesforce Classic

Step-6: The Property object page is open, After clicking on the property object, under this page, we can see the details related to the object.

After that scroll to the bottom of the page, and we can see that there is a custom field and a relationship section is present under this section we can see no fields are already created so when creating the new field click on the new button of Custom fields and relationship.

After clicking on the new button, The data type page opens. There are lots of data types present on the page. Here we are selecting the lookup relationship data type field that is present at the bottom of the page. 

The relationship field allows the user to click on the lookup icon to select the value from a popup list. After selecting the data type click on the next button.

How to Change the text field to lookup field in Salesforce Classic

Step-7: After choosing the field choose the related object. Select the other object to which this object is related and here we are selecting the property object from all the related to options and then click on the next button.

Change the text field to lookup field in Salesforce Classic

Step-8: Here we are entering the label and name for the lookup field and here we are first entering the field label and giving the label as Property agent and the field name which is automatically fielded by simply clicking on the field name and then clicking on the next button.

Salesforce Classic Change the text field to lookup field

Step-9: The next step is to establish field-level security, After clicking on the next button. 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.

Here we want to select all the field-level security for the profile so we click on the visible checkbox all the checkboxes are checked and then click on the next button.

How to Change an text field to lookup field in Salesforce Classic

Step-10: After establishing the field level security, now we can add a reference field to the page layout by selecting the page layout that should involve this field.

The field will be added as the last field in the first two-column section of these page layouts. The field will not appear on any pages if we do not select a layout. After that click on the next button.

Now add the custom related list, specify the title that the related list will have in all of the layouts associated with the parent, and then select the page layout that should involve this field. After that click on the save button that is present at the top and the bottom of the page.

Change an text field to lookup field in Salesforce Classic

Step-11: Now click on the save button, and our text field is changed into the lookup field. Now click on the property object that is placed on the nav bar. The Property page is open and under this page, there is no record that is already created. For creating the new record click on the new button.

The new property page is open, we can fill the complete information related to the property. Here we are first filling the property name and then fill the address related to the property and then fill the property agent. You can see that our property agent field is the text field we can simply add the plain text inside the field and click on the save button.

How to Change the text field to the lookup field in Salesforce Classic

Step-12: Now click on the agent object that is present on the nav bar. The agent page is open and under this page, there is no record that is already created. For creating the new record click on the new button.

The new agent page is open, we can fill the complete information related to the agent. Here we are first filling the agent name and then fill the property agent. You can see that our property agent is in the form of a lookup when we click on the lookup icon, the lookup dialogue box is open and here we can select the property agent simply with just one click.

After selecting the property agent from the lookup dialogue box, the agent is set on the field, and click on the save button.

Change the text field to the lookup field in Salesforce Classic

Here you can see that the property object has a propertyagent field of text field type. Then we create a lookup field on the agent object with the same name as the property agent object.

And this lookup field creates a relationship between these objects, our agent works as a child relationship name, and the property field works as the parent relationship and we can see that our text field is converted into a lookup field with the help of this method.

So with this, we understand how to change the text field into the lookup field in Salesforce Classic.

Conclusion:

In this whole blog, we have learned how to change the text field into lookup field in Salesforce we simply choose the object and see there is a text field and we change this text field to a lookup field then we select another object and create a lookup field by selecting the lookup datatype. After that select the related to option that can our text field to lookup field in Salesforce.

I hope you read the complete article and get the complete idea related to how to change the text field to the lookup field in Salesforce.  I have also explained all the steps of changing the text field to the lookup field in Salesforce Lightning and Salesforce Classic.

You may like to read