Link Two Lists and Display the Data Using the SharePoint Data View
Guest Author: Devin Walker
DLOCC, Inc.
Do you have two lists that you would like to display their data in one convenient location? Well, the SharePoint Data View should work perfectly for this type of use. Follow along with the article to understand more about using the Data View to connect two list and display information of your choosing.

To begin, you must have SharePoint Designer 2007 and appopriate permissions within both lists and the site(s). Also, some general understanding of MOSS is always a plus. Got it? Good, let’s continue.
Getting Setup:
- Open the Site holding the page you wish to display the data view on in SharePoint Designer 2007.
- Detach the Page from the Layout and Check it out so we can edit it using SPD
- Once the page has finished loading select the appropriate Web Part Zone and click Data View > Insert Data View
- Expand Linked Sources and click Create a new Linked Source…
- Add lists you want linked from the Available Data Sources to the Selected Data Sources and click Next
- For this example we will be using the “Join the contents of the data sources…” option; when you are done click Next
- In the Data Source Task Pane expand the drop-down to our newly created Linked source and click Show Data
- Select the appropriate columns from each data source and expand the Insert the Selected Fields as… drop-down and insert as either single or multiple item view (depending on your preference).
- Now you will see the data in either a side-by-side view or stacked (depending on if you joined or merged when linking the two data sources)
- Pretty it up a bit and make the Data View display the information how you want, save the page, reattach to the page layout and, finally, check in to major version.



You will now see the Data Source Library Task Pane on the Right Panel

Please note: If your lists are on another site collection you will have to use the Connect to another library… link

The Data Souce Properties window pops up; click Configure Linked Source…





Guest Author: Devin Walker
DLOCC, Inc.
About: Devin Walker is a professional web designer, SharePoint enthusiast and founder of the consulting company DLOCC, Inc.. Devin has years of experience working with companies of all sizes to successfully implement, test and launch SharePoint enterprise content management systems. He writes about his experiences on his blog: DLOCC | Articles and Tutorials
- How to remove the “title” column from a SharePoint list
- SharePoint Errors, Warnings and Problems Collection
- Link Two Lists and Display the Data Using the SharePoint Data View
- SharePoint Workflow Time Zones
- Redirect a SharePoint site by using the Content Editor Web Part
- How to Move SharePoint Calendars Fast
- Style a Page using the Content Editor Web Part and CSS
Great step-by-step!
Also, here’s a screencast that I did, which is similar:
http://www.endusersharepoint.com/2009/07/23/4-minute-screencast-join-view-of-sharepoint-lists/
“Join View of SharePoint Lists”
Cool, glad you like it! Great minds think alike :]
Is there a way to do calculations ‘cross-lists’ using the calculated column method?
Or do I have to rely on a workflow to ‘copy-paste’ the data from one list to another to be able to use the ‘value’ for calculations?
Thanks,
Greg
Greg,
In order to do that, you’d have to create the formula within the data view web part, and use XSLT code. You can create a new column in the data view web part, and then in a cell, right click and choose “insert formula”. This allows an interface to create your own formula.
Greg,
Yup, that’s possible, though the XSL can be scary. I’ve blogged a bit of an example of what you can do. http://www.novolocus.com/2009/03/25/linking-list-data-and-summing-over-it-with-xsl-and-the-dataview-web-part/
Devin
Is it possible to perform a vlookup type function via Data Views? For example if I have an Employee List and a Meeting Attendance List would it be possible to Lookup the Employee Name against the Meeting Attendance List and return ‘Attended” or “Did not Attend”?
Hi Devin
Your article is great and very useful thanks for this stuff.
but i have one question.
can i do this with three list ? following lists i am using
Product , vendor, and PeoductandVendor product and vendor list have mm relationship so i create PeoductandVendor list fk_productid and fk_vendorid
With this three list we retrieve vendor names group by product,
using SharePoint Data View.
Is it possible or not? and how i can achieve
and sorry for my English.
Pankaj,
Yes, it’s possible to add as many lists/libraries as you want.
Hi, great post. I’m trying to do something similar, but am unable to get my new linked source to join like I want.
I have a SP 2010 list and an xml file that I want to join. I have a column in the list called ProductsTechnologies and a node/column in the xml file called productname. The values in both of these columns match but the column names do not. I would like to do a data view sub join showing all the items from the list that match each of the node/column values in the xml file. I can’t seem to get the join process to work correctly in SPD 2010. I can’t specify anwhere that the ProductsTechnologies column should join with the ProductName column. Is this possible to do somehow, or do the 2 column names have to match?
thank you very much!