Back Forward Home Print Search
Windows SharePoint Services 3.0 Help and How-to >  Customizing sites, pages, lists, and libraries >  Customizing pages by using Web Parts
Connect data in Web Parts
Connect data in Web Parts

In many products and technologies, connecting sets of data from different data sources is challenging and requires programming skill. However, you can use the menus and buttons within a Web Part (Web Part: A modular unit of information that consists of a title bar, a frame, and content. Web Parts are the basic building blocks of a Web Part Page.) to create data connections without writing any custom code. For example, by connecting Web Parts, you can present data from two Web Parts in alternate views, perform related calculations between two Web Parts, and filter a Web Part by using values from another Web Part  — all on one Web Part Page (Web Part Page: A special type of Web page that contains one or more Web Parts. A Web Part Page consolidates data, such as lists and charts, and Web content, such as text and images, into a dynamic information portal built around a common task.).

In this article


Overview of Web Part connections

By using Web Part connections, you can create or enhance your Web Part Pages. You connect Web Parts so that when you perform an action in one Web Part, it changes the contents of another Web Part.

For example, you can connect an Employees List View Web Part to the Image Web Part by passing data between the two Web Parts. Each time you select a row in the Employees List View Web Part that contains a column with a picture of that employee, you can see the picture displayed in the Image Web Part.


Basic Web Part connection

Callout 1 A Web Part connection is a way to pass data from one Web Part to another Web Part and synchronize their behavior.

Callout 2  One Web Part provides the data.

Callout 3 Data can be lists, rows, cells, or parameter values.

Callout 4 The other Web Part gets the data.


You can create the Web Part connection from either Web Part by using the connection type submenu from the Connections command on the Web Part menu. For example, if one Web Part's connection type submenu command says Provide Row To, the other Web Part's connection type submenu command says Get Row From.

Not only can you create Web Part connections on the same Web Part Page, but you can also create connections between Web Parts on two different Web Part Pages in the same top-level site by using a Web design program that is compatible with Microsoft Windows SharePoint Services, such as Microsoft Office SharePoint Designer 2007.

 Top of Page

Create Web Part connections

Creating a Web Part Page with Web Part connections is a three-step process.

Step 1: Decide what data you want available on the Web Part Page

Often, there are one or more List View Web Parts that provide the data that you want. Lists present your data in a tabular format and make it easy to modify and refresh data, change the sort order, filter within the list, and aggregate data. By using the view selector in the tool pane, you can change the view of a List View Web Part, to work with just the columns that you need.

Step 2: Add the Web Parts to the Web Part Page

Most lists are available as List View Web Parts in your site Web Part gallery. Other Web Parts are usually available in other Web Part galleries that you have access to. Sometimes, you may need to import a Web Part from another site that has an interesting or useful instance of a Web Part. You can also search for Web Parts on external Web sites and then request that they be installed on your Web site by your site administrator. For example, you can find Web Parts in the Microsoft Office SharePoint Server 2007 Web Component Directory or on a Web site from another software manufacturer. Over time, your Web Part galleries will grow and adapt to your needs and the needs of your organization.

Step 3: Connect the Web Parts to get the results you want

You can create connections only between Web Parts that support Web Part connections. Web Parts that support Web Part connections include the List View Web Part, Form Web Part, and Image Web Part. The Connections submenu on the Web Part menu displays only the type of connection that you can create, and the available Web Parts submenu displays only compatible Web Parts. After you complete steps 1 and 2, decision-making is simple and no knowledge of scripting or coding is required to make the Web Part connection.

 Note    You can create connections only between Web Parts that are on the same Web Part Page. To connect a Web Part to data from another site or data source, you add a data view by using a Web design program that is compatible with Microsoft Windows SharePoint Services, such as Office SharePoint Designer 2007.

 Top of Page

Create or change a connection between two Web Parts

By using menus and dialog boxes, you can connect Web Parts, pass data between them, and synchronize their behavior.

  1. Open the Web Part Page.
  2. On the Site Actions menu Site Actions menu, click Edit Page.
  3. Decide which two Web Parts you want to connect. You can create or change the same connection by starting from either Web Part.
  4. From either one of the Web Parts, click the Web Part menu Web Part Edit Menu, point to Connections, point to the type of connection that you want to create or change, such as Provide Row To or Get Sort/Filter From, and then click the name of the Web Part for which you want to create or change a connection.

    The Web Part menu may not be enabled or visible on your Web Part Page for several reasons, including that the Web Part or the zone does not support connections, you are using a browser that is not compatible with Windows SharePoint Services, or connections are disabled on your site.

  5. For some Web Part connections, you might need to select additional information in the Configure Connection dialog box. For example, you might need to select the connection type that you want to use or a column that you want to filter. Also, depending on how one or both of the Web Parts were created, you may see additional dialog boxes that are unique to the Web Part connection. For more information, see the Help information, if any, for the custom Web Part.
  6. Tip  You can hide a Web Part if you want to use it to provide data to another Web Part through a Web Part connection, but you don't want to display the Web Part.

 Notes 

  • The connection type submenu can vary from Web Part Page to Web Part Page and from Web Part to Web Part for several reasons, including differences among the property settings for the Web Part Page, Web Part, or Web Part zone, the type or compatibility of Web Parts on the page, and whether the Web Parts have compatible connection types.
  • Only Web Parts that can be connected appear on the available Web Parts submenu. Some Web Parts on the Web Part Page may not be designed to make connections, some Web Parts may not support connections to the current Web Part, or certain connection limits may currently be exceeded.

 Top of Page

Complete a Web Part connection in the Configure Connection dialog box

You use the Configure Connection dialog box to match columns between the Web Part that gets the data and the Web Part that provides the data.

 Note     You can make a connection that is correct, but not meaningful. For example, the Web Part that provides the data may have a product ID column and the Web Part that gets the data may have an employee ID column. Although you can match these columns, the results will not make sense.

In the Column list box, select a column from the Web Part that gets the data, the Web Part that provides the data, or both.

The following are common examples:

  • Matching a row of data in one Web Part to a cell or field of data in another Web Part  

    The Web Part that you are connecting from is a Contacts List View Web Part. One of the columns in the list view is a column that contains a hyperlink called Photo, which contains a URL to a picture of the contact. You make a connection to the Image Web Part, which can display only a URL that contains a picture. You need to choose the Photo column from the Contacts Web Part to provide the correct match to the Image Web Part.

  • Matching a row of data in one Web Part to a column of data in another Web Part so that you can filter it  

    The Web Part that you are connecting from is a List View Web Part that contains order data. One of the columns in the list view is a column that contains a line item called OrdersDetailsID. You make a connection to another List View Web Part that has several columns that contains order details, one of which is a matching column called OrdersDetailsID. To connect the two Web Parts so that when you select the order in one Web Part, it displays each line item for that order in the other Web Part, you must match the OrdersDetailsID columns in each Web Part.

     Note    The column names do not have to be the same, but the underlying data must match or have the same value.

 Top of Page

Remove a connection between two Web Parts

  1. Open the Web Part Page.
  2. On the Site Actions menu Site Actions menu, click Edit Page.
  3. From either one of the Web Parts from which you want to remove the connection, click the Web Part menu Web Part Edit Menu, point to Connections, point to the type of connection that you want to remove — for example, Provide Row To or Get Sort/Filter From — and then click the name of the Web Part from which you want to remove a connection.

     Note    A check mark appears on the connections submenu for each selection that has a connection enabled. If you do not see a check mark, no connection is enabled.

  4. In the Configure Connection dialog box, click Remove Connection.
  5. When you are prompted to confirm that you want to remove the connection between Web Parts, click OK.
 Top of Page

Common types of Web Part connections

There are many ways to combine and connect Web Parts on a Web Part Page. You can create several of these Web Part connections on your Web Part Page. The following scenarios describe common types of data connections between Web Parts.

 Top of Page