Two SharePoint lists in DataView - Linked Sources with SharePoint Designer

In the following, I describe how to show content from two lists in the same view. Here is a simple list of items on a SharePoint page. The items are residing in two different lists:

Two SharePoint lists One Data View

Lists are called, Wave 1 and Wave 2.
Wave 1 list is a custom list with Title column:

Two SharePoint lists One Data View

Wave 2 is as simple as Wave 1:

Two SharePoint lists One Data View

I opened the site with lists in SharePoint Designer, and I chose "Data Sources". Then I clicked on "Linked Data Source":

Two SharePoint lists One Data View

I selected Wave 1 and Wave 2 in the Wizard:

Two SharePoint lists One Data View

And I chose the "Merge" option, so I can sort and filter the content as it was one single list:

Two SharePoint lists One Data View

I have a data source now, and I need a page to do a web part that shows the content.
I clicked on "Site Pages" and I added new "Web Part Page"

Two SharePoint lists One Data View

Yes, it's called Untitled_4.aspx :o)

Then I clicked on "Insert" tab in the ribbon, and selected DataView button. The last item in dropdown is my "Linked Data Source" called "New Data Source":

Two SharePoint lists One Data View

I clicked on "Add/Remove Columns":

Two SharePoint lists One Data View

I removed "Modified" column:

Two SharePoint lists One Data View

I found the "row view" in code for DataView web part. "Row view" contains XSLT that is used to display items:

Two SharePoint lists One Data View

I changed:
<xsl:value-of select="@Title" /></td><td class="ms-vb">
<xsl:value-of select="@Editor" />
to:
<xsl:value-of select="@Title" /></td><td class="ms-vb">
<xsl:value-of select="@Editor" disable-output-escaping="yes" />

When "disable-output-escaping" is set to "yes" the column is displayed as HTML and not as text. @Editor column contains HTML that renders as Lync presence and Editor's name that is link to MySite.

Then I clicked on "Sort & Group" in the ribbon and sorted the view by Title:

Two SharePoint lists One Data View

I clicked on "Web Part" in the ribbon and I selected "To Site Gallery":

Two SharePoint lists One Data View

DataView with two lists as data source is saved as web part on the site now.
I can go and open a page and add a web part. When I edit a web part, I can make changes to the XSLT view:

Two SharePoint lists One Data View

And the web part looks like this:

Two SharePoint lists One Data View




This is only SharePoint. We are not in business of saving lives. Cool and other options in Pay Now are here if you think this blog post helped you.

Comments