What is a list?
According to the SPS Admin guide, list is a collection of information that you share with team members. SharePoint has a set of built-in lists. You can customize these lists or even create your own lists. You can import an excel sheet in SharePoint to create a list automatically. The data in the newly created list will be extracted from the excel sheet. In document and form libraries, you can create custom columns or metadata properties and interestingly, you can autopopulate these columns with data that can be hardcoded or extracted from other lists that are part of the same site where your document library is located. This is a very common question. People ask me how they can populate a column with data from another list.
Recently, some one emailed me the following question:
I have a list of Projects in SharePoint called as "Projects" and list contains following columns:
1. Project Name
2. Project Manager
3. Status
I want to make another list called "Project Milestones" where one of the fields in this list would be the name of the Project from the "Projects" list.
Is there a way to have this be a drop down that points to the "Project Name" field from the "Projects" List?
Of course, yes! We can pull data from other lists to be displayed in our list.
Here is the answer to the question emailed by the user:
1. Add a new column in your "ProjectMilestones" list. This is the list where you want to show data from the other list. This can a document library or a form library, depending on your needs.
2. Name the new column as "ProjectName".
3. Column type should be "Lookup"
4. In the "Get Information From:" drop down under "Optional Settings for
Column", select "Projects" list.
5. In "In this column" drop down, select "Project Name".
6. Click OK.

This newly added field will display project names from the "Projects" list.
Let's talk about the lookup field a bit. Lookup field refers to values from a field in another list as you saw above. It's a great way of linking two lists together. You can easily pull column values from different lists already available in your site. If you are a programmer like me, then you may want to look at the way how we can add a lookup field to the form programmatically. Here is the code:
SPSite site = SPControl.GetContextSite(Context);
SPFieldCollection fields = site.AllWebs["mysite"].Lists["mylist"].Fields;
SPList lookupList = site.AllWebs["mysite"].Lists["mylookuplist"];
Guid lkListID = lookupList.ID;
fields.AddLookup("Lookup_FieldName", lkListID, true);
If you work regularly with SharePoint, then you will find this tip to be very helpful.
Sarah DalePosted Nov 10, 2020, 10:33 AM
Hello Shafiq, do you have an update for this for SharePoint Online?
mayur sorathiyaPosted Jul 6, 2020, 2:37 AM
Hi Shafiq, Some Field are not get in lookup Field [like drop-down,currency] How to get Drop Down Column In lookup List?
kalu singh raoPosted Jul 6, 2016, 1:50 AM
Nice...
Lakshmy sriPosted Dec 23, 2011, 1:27 AM
I have a list with all employees details with phone No,Projects etc . And When user enters his emp Id for some registeration,all static informations should be fetched and displayed in the form. Could you please help me to work on this. I am using sharepoint 2007. Thankzz.
John NPosted Dec 22, 2011, 4:58 AM
Hi Shafia, This is very helpful. I'm very new to SharePoint but have 10+ years of C# ASP.NET experience. Could you please help me with the below queries? 1. How to add the above code to the SharePoint List and do stuff programmatically in a list. 2. To Clone Project XYZ rows to New Project a. I have SharePoint LIST with ‘Project Month’ column. Under this Project Month (say December 2011), I have list of projects related to Project Month. b. Next Month (Jan 2012) I have to clone all the Projects under December 2011 to Jan 2012 with all the data. But also have to do some calculation while cloning. Could you please provide some guidance to go in right direction how to achieve the above task. Say I want to add a button (To Clone Project XYZ rows to New Project) to a SharePoint List page and then want to programmatically copy the list rows from Project XYZ row and clone them to with new Project name Abc with all the rows under the Project XYZ Thanks John
Srinivas RaoPosted Jul 22, 2011, 2:14 AM
Hi, Am Srinivas, I have a list Address with ID field as a LookUp filed in another list named Customer field name Customer_ID which allows multiple values. Am trying to add the Customer_ID using API. Address ID's 1,2,3,4 needs to update the Customer_ID. But Customer_ID will updates with 4, last ID from Addres. Please any one suggest me. Thanks.
Shannon JonesPosted Oct 11, 2010, 12:10 PM
I am trying to use a column in an existing Sharepoint List "Clients" to populate a new list "Sales Pipeline". I have gone through the steps in this article. When I get to the Get Information portion, I selected "Clients", but then when it asks from which column, the column I need is not listed?? Can you advise how to resolve this issue? Thank You! Shannon
eliza sahooPosted Jun 24, 2010, 8:09 AM
For each item in a SharePoint list,an ID is associated with it.This ID is automatically generated when we add a List item. It is easy to get the item id after the item is added(either programtically or by viewing the ID column of the list).But how to get the ID of the item before the item is added to the list ? Here is a solution to this problem. public static int NextListItemID(SPSite oSite, Guid listId) { int listItemId = -1; Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(delegate() { if (oSite.WebApplication.ContentDatabases.Count > 0) { //Get the connection string for the sharepoint database string connString = oSite.WebApplication.ContentDatabases[0].DatabaseConnectionString; //Establish a connection SqlConnection con = new SqlConnection(connString); try { con.Open(); Sharepoint migration 2010
swaminathanPosted Mar 31, 2010, 8:56 AM
I am looking for a solution to link the title column to the document in a document library. any solutions available. Please help!
eliza sahooPosted Feb 8, 2010, 7:10 AM
Good one. Even i wold like to add on to this You can think of a SharePoint List somewhat similar to a table present within a Database. As tables consist of different columns, a SharePoint List also comprises of different columns / fields and these fields can indeed have different attributes associated to it (like "Required field check", "Max Length", "Display Formats", etc).We can use SharePoint API to create these fields and associate the corresponding attributes programmatically within an existing List. Thanks Eliza
PawanPosted Oct 1, 2009, 12:10 AM
Hi Shafiq, Is it possible to create workflow to move entire row from one list to other list on a same site when any net item is created or modified in first list. Please response.
LaurenPosted Jul 7, 2009, 2:57 PM
I have my lists set up and the lookup column works great until there is a major update to the "base" list. When new data is entered, its pushed to the connected lists but not automatically displayed on the subsequent list making it tough to recognize when there is updates made. Do you know of a way to make the lookup fields automatically repopulate? Thanks, Lauren
sergio giustiPosted May 7, 2009, 6:13 AM
I have 2 lists. The first has the following kind of info in it. NAME DEPARTMENT JOB ROLE David Scott ICT Technician Mark Jones ICT Technician Andrew Parker Sales Salesman I am wanting a second table to give me a summary of the information in the 1st table. What i want exactly is for the 2nd table to diaply a count of the number of instances in a column and display that information in the 2nd list based on what i enter into column 1 in the 2nd list. i.e. JOB ROLE COUNT OF ROLES Technician 2 Salesman 1 The 2nd table is using the values i entered into the 1st column to lookup and count the number of that instances from the 1st table and then returning the results. Is this possible to do ? thanks for the assistance. Sergio
haric baharPosted Mar 26, 2009, 8:22 PM
Hi Shafiq I have one custom list Course and another custom list Registration. course custom list has fields like id , course name etc. in registration list i created a look up coulmn id to pull the course id from course list. i have another column course title in registration list. so if i select course id 10 in registration list , i want to auto populate the course title which has course id 10. how do i do that? any help would be much appreciated. i can make course title look up column and select the title form the drop down manually. since i have too much of data in list , it is real pain for me to manaully select the title. is there any work around to auto populate the course title in registration list based on the ID. i am new to sharepoint and i am totally lost here. please help Thanks Hari
LarryPosted Oct 21, 2008, 10:46 AM
I have two SharePoints lists, Project List and Effort List. Multiple records in the Effort List tie to an individual record in the Project List. I can use the Lookup (information already on this site) field/column in the Effort List to allow uses to select a field in the Project List. Where I can't figure out what next is it will only bring back the field they selected from the Project List, but what I want is it to bring back multiple fields from that selected record. Example: Project List has multiple records, with four fields each: Project ID, Project Description, Project Cost, Project Due Date Effort List has multiple records, with three fields each: Project ID, Effort Description, Effort Status If Project ID abc is selected in a drop down within the Effort List New Item entry, I want to bring back more than Project ID abc, I also want to display Project Description, Project Cost and Project Due Date. I have SharePoint Designer 2007. Any help is appreciated.
radix punePosted Dec 11, 2007, 1:12 AM
If there are 2 subsites under one root how to use lookup from list of one site to other? is it possible?
Mubaraka SehorewalaPosted Sep 11, 2007, 7:26 AM
He can v link a column on a site from a list on another site?
Jesse McRaePosted Jul 13, 2007, 2:54 PM
I have tried a number of methods to link supervisor names from a sheet containing employees with their respective supervisors (called "Employee List") to a sheet containing employees with their tasks (called "Tasks"), so that supervisors will show up there as well linked to tasks (for email reminder purposes), and keep running into the problem that "In this column" only offers "ID" and "Title" as options, neither of which are even column names in the "Employee List" list. I added a separate column in "Tasks" called "Supervisors", type "Lookup", get information from "Employee List", and then the snag that it does not give me the correct column options that are in the file. Any idea why this is happening or what I could to to correct it? Thank you very much for your help!
SachinPosted Oct 27, 2006, 3:33 PM
Hi Shafiq, Your submission was really helpful. Can you help me with the following? I've one custom list (List1)with field with following three columns, Name Age Salary and SharePoint "ID" I want to populate Salary Column in another list (List2) with exact values from Salary column of List1. Your help is greatly appreciated. Thanks, Sachin