Create Linked Lists in SharePoint 2010
Getting Started with Web Development in SharePoint 2010: Learn how to create lists that are linked together in SharePoint 2010.
Applies to: SharePoint Foundation 2010 | SharePoint Server 2010 | Visual Studio 2010
In this article
Create the Lists on the SharePoint Site
Create Columns for the Lists
Add Data to the Lists
Next Steps
Published: June 2010
Provided by: Frank Rice, Microsoft Corporation
In this exercise, you create two lists in Microsoft SharePoint 2010. Then you create a lookup column in each list that links to data in the other list. To complete this task, you must do the following:
Create the Lists on the SharePoint Site
Create Columns for the Lists
Add Data to the Lists
Create the Lists on the SharePoint Site
In this task, you create two lists in SharePoint 2010.
To create the two SharePoint lists
Open the SharePoint site you want to use in these procedures (such as https://localhost/sites/MySampleWebSite) in Internet Explorer.
Click Site Actions, click More Options, and then click Custom List.
In the Name box, type Employees, and then click OK.
Click Site Actions, click More Options, and then click Custom List.
In the Name box, type Projects and then click OK.
Create Columns for the Lists
In this task, you add columns to the two lists.
To create the list columns
In the left navigation pane, click the Projects list, and on the ribbon user interface (UI), under the List Tools tab, click List, and then click List Settings.
Scroll down to the Columns section and then click Create column.
In the Column Name box, type Description, and then click OK.
Scroll down to the Columns section and then click Create column.
Name the column Due Date, specify its type as Date and Time and its format as Date Only, and then click OK.
Navigate to the Home page.
In the left navigation pane, click the Employees list, and on the ribbon user interface, under the List Tools tab, click List, and then click List Settings.
Scroll down to the Columns section and then click on Title.
Change the name of the column to Fullname and then click OK.
Scroll down to the Columns section and then click Create column.
Name the column JobTitle and then click OK.
Repeat the previous steps to create the Team and Contribution (in Milestones) columns. Specify the type of the Contribution (in Milestones) column as Number. Click OK.
In the Columns sections, click Create column.
Name the column Project, and then specify its type as Lookup.
In the Additional Column Settings section, set the Get information from drop-down box to Projects and the In this column drop-down box to Title.
Now create a lookup column in the Projects list. Navigate to the Home page.
In the left navigation pane, click the Projects list, and on the ribbon user interface, under the List Tools tab, click List, and then click List Settings.
Scroll down to the Columns section and then click Create column.
Name the column Primary Contact, and then specify its type as Lookup.In the
Additional Column Settings section, set the Get information from drop-down box to Employees and the In this column drop-down box to Fullname.
Add Data to the Lists
In this task, you add data to the two lists.
To add data to the lists
Navigate to the Home page and then click the Employees list.
Add each row of data shown in Table 1 to the list by clicking Add new item, and filling in each column. Notice that as you fill in the Project column, you can choose from the list of items from the Title column in the Projects list.
Table 1. Employees data
Fullname
JobTitle
Team
Contribution (in Milestones)
Project
Nancy Davolio
Test Lead
Testing
2
Writing more sample code.
Robert Fuller
Developer
Development
3
Writing developer articles.
Margaret Peacock
Developer Lead
Development
2
Writing developer articles.
Janet Leverling
Program Manager
Testing
4
Answering forum questions.
Lisa Miller
Tester
Testing
5
Building more developer tools.
Joe Healy
Tester
Testing
3
Answering forum questions.
Click the Projects list and then click Add new item and add the data in Table 2. Notice that as you fill in the Primary Contact column, you can choose from items in the Fullname column in the Employees list.
Table 2. Projects data
Title
Description
Due Date
Primary Contact
Writing more sample code.
Customers need samples to write code from.
12/31/2009
Nancy Davolio
Building more developer tools.
Tools are fun to build and use.
5/16/2009
Lisa Miller
Answering forum questions.
Helping new developers to learn.
6/15/2009
Janet Leverling
Writing developer articles.
Everyone needs more details.
4/15/2009
Robert Fuller