Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

FREE Webcast - Delivering Microsoft SQL Server High Availability on AWS
 

Using SharePoint Web Part Connections


By:   |   Read Comments   |   Related Tips: > Sharepoint

Problem

Displaying relative information in the form of a master - detail view is one of the most common UI requirements.

For instance, a company could have several departments, and departments could have several employees. In most cases, there would be separate list of department and employees. One can use the list viewer web part to show department and employees all together at same page. But consider a scenario where the requirement is to display employees of the corresponding department.

In this tip we will look at how to deal with this requirement in SharePoint using "Web Part Connections".

Solution

"Web Part Connections" allow you to connect two different web parts on the same page. Conceptually speaking, one web part provides an input from a column to another web part's column. Depending upon the input, the target web part will get filtered. In this article, we will discuss how to use web part connections to solve the problem in question.

In the screenshot below, there are two list viewer web parts to display records from the Department List and the Employees List. The only common / matching data between the two lists is the DepartmentName column in Department List and the EmpDepartment column in Employees list. We will use this column to connect both web parts.

department code

Select the Site Action -> Edit Page menu item.

As shown in the screenshot below, select Edit -> Connections -> Get Sort/Filter From -> Department. Here the Department web part placed as a separate web part above the employees web part.

department

Select Column DepartmentName for the Department List and Click on Next.

department name

Select Column EmpDepartment for the Employees List and Click on Finish.

emp department

Click on Exit Mode.

Now you will be able to see two things:

  • A selection button will appear in front of source web part records. Selecting of a record in Department web part will act as input to the Employees web part
  • The corresponding records will get displayed in the target web part. The same can be seen in the screenshot below.
energy resources

Now change the selection of DepartmentName to "Financial Securities" and you will notice the difference.

financial securities

In summary, by using web part connections one can easily create master detail function linking between different web parts.

Next Steps
  • Use Web Part Connections to connect more than one web parts and filter the data.
  • Use Web Part Connections with business data catalog web parts to effectively sort third party data and display relative data


Last Update:


next webcast button


next tip button



About the author
MSSQLTips author Siddharth Mehta Siddharth Mehta is an Associate Manager with Accenture in the Avanade Division focusing on Business Intelligence.

View all my tips





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools