Connect a Filter Web Part to a List View Web Part

You can configure a filter Web Part to pass a value to a List View Web Part, and then change the view of data in the list based on the value. For example, when you select from a list of product orders in a Choice Filter Web Part, a connected List View Web Part can display the products that correspond to that order.

What do you want to do?

Learn about connecting a Filter Web Part to a List View Web Part

How filter Web Parts work

Ways to filter a List View Web Part

Best practices for designing and maintaining pages

Connect a Text Filter Web Part to a List View Web Part

Connect a Date Filter Web Part to a List View Web Part

Connect a Choice Filter Web Part to a List View Web Part

Connect a Current User Filter Web Part to a List View Web Part

Connect a SharePoint List Filter Web Part to a List View Web Part

Learn about connecting a Filter Web Part to a List View Web Part

This section discusses the ways that you can filter a List View Web Part, and best practices when you design and edit a page that contains connections between a filter Web Parts and List View Web Part.

How filter Web Parts work

In general, connecting a filter Web Part to a List View Web Part works in the following way:

Filter Web Parts

Connect a filter Web Part to a List View Web Part to display a subset of data.

The filter Web Part provides a value.

The filter value is passed to a column in the List View Web Part by using a Web Part connection.

The List View Web Part displays only those rows or items that match the filter value.

Ways to filter a List View Web Part

You can connect a filter Web Part to a List View Web Part so that a user can filter items based on a value in a column in the following ways:

  • Text filter    A text value that can be any string, including letters, characters, and numbers.

  • Date filter    A date value of month, day, and year. A user can also enter the exact date by clicking a date picker button.

  • Choice filter    A predefined list of values and optional descriptions, such as product or status codes.

  • Current user    The current user name, or other information based on the current user's profile, such as user name, department, or birthday. This Web Part is a context Web Part, which means that it is not visible to a user of the page and the results appear automatically without user input.

  • SharePoint list    A list of unique values and optional descriptions, such as product or status codes, generated from a column in a SharePoint list. This Web Part is similar in behavior to the Choice Filter Web Part, and is useful when you have a list of values that might change over time and you want an easier way to maintain the list without having to change the Web Part properties.

    Notes   

    • You can only connect a filter Web Part to a List View Web Part that is in standard list view, not in datasheet view.

    • You can pass only one value at a time to a List View Web Part. You can configure only one connection at a time between a filter Web Part and a List View Web Part. However, you can add multiple instances of the same List View Web Part to a page, and then configure a different connection to each List View Web Part. If you want to configure two or more connections at a time for a Web Part, consider using the Data View Web Part and making the connection in SharePoint Designer 2010.

Best practices for designing and maintaining pages

Here are a few best practices to follow as you design and maintain pages:

  • Choose your Web Part Page template carefully    You can move Web Parts around on a page or a Web Part Page to place them in any order and in any Web Part zone or text layout that you want. However, before you create a Web Part Page, think carefully about the template that you choose so that you can lay out the filter and List View Web Parts the way you want. When using a Web browser, you cannot change the template that you selected after you created the Web Part Page. If you have a Web design program such as SharePoint Designer 2010, you can further change the structure of the Web Part Page.

  • Remove connections to disabled Web Part properties    In page edit mode, you can see which filter Web Parts are currently connected and how they are connected by a message that is displayed underneath the filter Web Part.

    In some cases, you may need to remove the connection to make a change to a disabled filter Web Part property. If this is the case, in the tool pane you see the following message to remind you: "You must remove the connection between the Web Parts to make changes to disabled properties."

  • Remove unused Web Parts from the page    If you inadvertently close a Web Part, rather than delete it, the Web Part remains on the page as a hidden Web Part. To find hidden Web Parts, find the page in the library in which it is stored, point to the file name of the Web Part, click the arrow that appears, click Edit Properties, and then click the Open Web Part Page in maintenance view link.

Top of Page

Connect a Text Filter Web Part to a List View Web Part

Note    The following procedure assumes you are creating a page on a team site. Commands and instructions can vary on other sites.

To edit a page you must have at least the permissions obtained by being added to the default <Site Name> Members SharePoint group for the site.

  1. From a page, in the ribbon, click the Page tab, and then click the Edit command.

    Edit command of the Page tab

    Note    If the Edit command is disabled, you may not have the permissions to edit the page. Contact your administrator.

  2. Click the page where you want to insert a Text Filter Web Part and List View Web Part.

  3. In the ribbon, click the Insert tab, and then click Web Part.

    Web Part command

  4. Under Categories, click Lists and Libraries, under Web Parts, click the List View Web Part you want, and then click Add. The new Web Part appears on the page.

  5. Click the Web Part menu down arrow for the List View Web Part, and then point to Modify Shared Web Part.

  6. In the Web Part tool pane, edit the custom Web Part properties by doing the following:

    • To change the default view of the list, select a different view from the Selected View list box. For example, you may want to filter, sort, or group data a different way or display different columns. Alternatively, click Edit the current view to edit the current view of the list.

      Note    Whenever you select or edit a list view, a copy of the list design is made from the original site list design and saved with the List View Web Part. However, the list data remains the same.

      Be careful when you switch to a different view from the current view. You may delete changes that you made to the current view and may disable Web Part connections that depend on columns in the current view. You are prompted for confirmation if you switch views.

    • To change the toolbar, under ToolBar Type, select Full Toolbar, Summary Toolbar, or No Toolbar from the list box.

  7. At the bottom of the tool pane, click OK.

  8. Under Categories, click Filters, under Web Parts, click Text Filter, and then click Add. The new Web Part appears on the page.

  9. To configure the Text Filter Web Part, do one of the following:

    • In the Web Part, click Open the tool pane.

    • Point to the Web Part, click the down arrow, and then click Edit Web Part. The configuration tool pane appears.

  10. In the tool pane, type a name in the Filter Name box to identify the Web Part.

    Tip    You can also use the name as a label or a brief instruction to the user. For example, you can use Filter Reports By: as a label to tell users they can filter the view of a Reports list.

  11. Optionally, in the Advanced Filter Options section, do one or more of the following:

    • To limit the number of characters, enter the number in the Maximum number of characters text box. The maximum length of a text value is 255 characters.

    • To enter an initial value in the Text Filter Web Part text box, enter a default value in the Default Value box. This default value is then used to display the initial list of values in the List View Web Part when the page first appears.

    • To display a message that reminds the user to make a choice to filter the data, select the Require user to choose a value check box.

    • In the Control width in pixels text box, enter a number indicating the width of the text box as the number of pixels, or an empty value or "0" to automatically size the text box. Because the value entered by the user appears in this text box, you probably want to make it wide enough for the largest possible value.

  12. At the bottom of the tool pane, click OK.

  13. To connect the Text Filter Web Part, point to the Text Filter Web Part, click the down arrow, point to Connections, point to Send Filter Values To, and then click the name of the List View Web Part to which you want to connect.

  14. In the Configure Connection dialog box, select the Connection Type, click Configure, set Consumer Field Name to the column that you want to filter the List View Web Part by, and then click Finish.

    Note    In the browser, you may need to enable pop-ups from this site to view the Configure Connection dialog box.

  15. When you are done configuring the connection, in the Page tab, click Save & Close to save and view the page.

To dynamically change the results that appear in the List View Web Part, enter some text in the text box for the Text Filter Web Part. Ensure that the text exactly matches a value in the column that you specified in the connection you made in step 14. After you enter the text, press ENTER to see the results. To redisplay all the values in the List View Web Part, clear the text box, and then press ENTER.

Note    The Text Filter Web Part does not recognize wildcard characters. If a user enters a wildcard character, such as an asterisk (*) or a percent sign (%), the character is interpreted as a literal character.

Top of Page

Connect a Date Filter Web Part to a List View Web Part

Note    The following procedure assumes you created a page on a team site. Commands and instructions can vary on other sites.

To edit a page you must have at least the permissions obtained by being added to the default <Site Name> Members SharePoint group for the site.

  1. From a page, in the ribbon click the Page tab, and then click the Edit command.

    Edit command of the Page tab

    Note    If the Edit command is disabled, you may not have the permissions to edit the page. Contact your administrator.

  2. Click the page where you want to insert a Date Filter Web Part and List View Web Part.

  3. In the ribbon, click the Insert tab, and then click Web Part.

    Web Part command

  4. Under Categories, click Lists and Libraries, under Web Parts, click the List View Web Part you want, and then click Add. The new Web Part appears on the page.

  5. Click the Web Part menu down arrow for the List View Web Part, and then point to Modify Shared Web Part.

  6. In the Web Part tool pane, edit the custom Web Part properties by doing the following:

    • To change the default view of the list, select a different view from the Selected View list box. For example, you may want to filter, sort, or group data a different way or display different columns. Alternatively, click Edit the current view to edit the current view of the list.

      Note    Whenever you select or edit a list view, a copy of the list design is made from the original site list design and saved with the List View Web Part. However, the list data remains the same.

      Be careful when you switch to a different view from the current view. You may delete changes that you made to the current view and may disable Web Part connections that depend on columns in the current view. You are prompted for confirmation if you switch views.

    • To change the toolbar, under ToolBar Type, select Full Toolbar, Summary Toolbar, or No Toolbar from the list box.

  7. At the bottom of the tool pane, click OK.

  8. Under Categories click Filters, under Web Parts click Date Filter, and then click Add. The new Date Filter Web Part appears on the page.

  9. To configure the Web Part, do one of the following:

  10. In the Web Part, click Open the tool pane.

  11. Point to Web Part, click the down arrow, and then click Edit Web Part. The configuration tool pane appears.

  12. In the tool pane, type a name in the Filter Name box to identify the Web Part.

    Note    You can also use the name as a label or a brief instruction to the user. For example, you can use Filter Reports By: as a label to tell users they can filter the view of a Reports list.

  13. To enter an initial value in the Date Filter Web Part text box, select Default Value, and then do one of the following:

  14. Select Specific Date, and then enter a specific date.

  15. Select Offset from today, enter the number of days in the Days text box (the maximum value is 999), and then select either After Today or Before Today.

    This default value is then used to display the initial list of values in the List View Web Part when the page first displays.

  16. Optionally, in the Advanced Filter Options section, to display a message that reminds the user to make a choice to filter the Date, select the Require user to choose a value checkbox.

  17. To save your changes, at the bottom of the tool pane, click OK.

  18. To connect the Date Filter Web Part, point to the Date Filter Web Part, click the down arrow, click Connections, click Send Filter Values To, and then click the name of the List View Web Part to which you want to connect.

  19. In the Choose Connection dialog box, select the Content Type, click Configure, set Consumer Field Name to the column that you want to filter the List View Web Part by, and then click Finish.

  20. When you are done configuring the connection, in the Pagetab, click Save & Close to save and view the page.

To dynamically change the results that appear in the List View Web Part, enter a date or click the Date picker button, and then press ENTER. The value that you enter must exactly match a value in the column that you specified in step 15. To redisplay all the values in the List View Web Part, you must clear the date from the text box, and then press ENTER.

Note    A user needs to enter the date in the short date format for the current regional setting used by the SharePoint site. The short date format can vary depending on your computer or site's regional setting. For example, for English (United States) use mm/dd/yyyy, and for French (France) use dd/mm/yyyy. The user can also use the date picker to ensure the correct date entry.

Top of Page

Connect a Choice Filter Web Part to a List View Web Part

Note    The following procedure assumes you created a page on a team site. Commands and instructions can vary on other sites.

To edit a page you must have at least the permissions obtained by being added to the default <Site Name> Members SharePoint group for the site.

  1. From a page, in the ribbon, click the Page tab, and then click the Edit command.

    Edit command of the Page tab

    Note    If the Edit command is disabled, you may not have the permissions to edit the page. Contact your administrator.

  2. Click on the page where you want to insert a Choice Filter Web Part and a List View Web Part.

  3. In the ribbon, click the Insert tab, and then click Web Part.

    Web Part command

  4. Under Categories, click Lists and Libraries, under Web Parts, click the List View Web Part you want, and then click Add. The new Web Part appears on the page.

  5. Click the Web Part menu down arrow for the List View Web Part, and then point to Modify Shared Web Part.

  6. In the Web Part tool pane, edit the custom Web Part properties by doing the following:

    • To change the default view of the list, select a different view from the Selected View list box. For example, you may want to filter, sort, or group data a different way or display different columns. Alternatively, click Edit the current view to edit the current view of the list.

      Note    Whenever you select or edit a list view, a copy of the list design is made from the original site list design and saved with the List View Web Part. However, the list data remains the same.

      Be careful when you switch to a different view from the current view. You may delete changes that you made to the current view and may disable Web Part connections that depend on columns in the current view. You are prompted for confirmation if you switch views.

    • To change the toolbar, under ToolBar Type, select Full Toolbar, Summary Toolbar, or No Toolbar from the list box.

  7. At the bottom of the tool pane, click OK.

  8. Under Categories click Filters, under Web Parts click Choice Filter, and then click Add. The new Choice Filter Web Part appears on the page.

  9. To configure the Web Part, do one of the following:

  10. In the Web Part, click Open the tool pane.

  11. Point to the Web Part, click the down arrow, and then click Edit Web Part. The configuration tool pane appears.

  12. In the tool pane, type a name in the Filter Name box to identify the Web Part.

    Tip    You can also use the name as a label or a brief instruction to the user. For example, you can use Filter Reports By: as a label to tell users they can filter the view of a Reports list.

  13. Enter the list of values and an optional description that you want a user to be able to select from the Select Filter Value(s) dialog box that appears when a user clicks the Filter button. For example, if you have a list of customers with a Status column, you can enter Standard, Preferred, and Elite as the list of values, each value on a separate line. These values are then used to match the values that appear in the Status column of the List View Web Part when a user enters a value and presses ENTER.

    For each value on each line, you can also add an alternative description that appears in the Select Filter Value(s) dialog box instead of the values when the user filters the data. For example:

  14. Standard; A regular customer with an average credit rating

  15. Preferred; A regular customer with a high credit rating

  16. Elite; A high-volume customer with a high credit rating

    Note    The list of choices must contain at least one choice and must be unique. Neither the value nor the description may exceed 255 characters in length. The maximum number of choices is 1000.

  17. Optionally, in the Advanced Filter Options section, do one or more of the following:

  18. In the Control width in pixels text box, enter a number indicating the width of the text box as the number of pixels, or an empty value or "0" to automatically size the text box. Because the value entered by the user appears in this text box, you probably want to make it wide enough for the largest possible value.

  19. To display a message that reminds the user to make a choice to filter the data, select the Require user to choose a value check box.

  20. To enter an initial value in the Choice Filter Web Part text box, enter a default value in the Default Value box. This default value is then used to display the initial list of values in the List View Web Part when the page first appears.

  21. To enable users to filter by a null value, select "(Empty)" value. For example, users may want to see all customers with no status defined.

  22. To enable the clearing of a filter so that users can see all the values in the List View Web Part, select Allow Multiple selections. In this case, the Select Filter Value(s) dialog box displays check boxes, rather than radio buttons.

    Note    You cannot use this feature to display the filtered results of two or more selections, because The List View Web Part does not support multiple selections. If a user chooses multiple selections, only the first selection is used.

  23. To save your changes, at the bottom of the tool pane, click OK.

  24. To connect the Choice Filter Web Part, point to the Choice Filter Web Part, click the down arrow, click Connections, click Send Filter Values To, and then click the name of the List View Web Part to which you want to connect.

  25. In the Choose Connection dialog box, select the Content Type, click Configure, set Consumer Field Name to the column that you want to filter the List View Web Part by, and then click Finish. When you are done configuring the connection, in the Pagetab, click Save & Close to save and view the page.

To dynamically change the results in the List View Web Part, in the Choice Filter Web Part, click Filter, click a value, and then click OK. If you selected the Allow Multiple selections property, to redisplay all the values in the List View Web Part, you must clear all the check boxes in the Select Filter Value(s) dialog box, and then click OK.

Top of Page

Connect a Current User Filter Web Part to a List View Web Part

Note    The following procedure assumes you are creating a page on a team site. Commands and instructions can vary on other sites.

To edit a page you must have at least the permissions obtained by being added to the default <Site Name> Members SharePoint group for the site.

  1. From a page, in the ribbon, click the Page tab, and then click the Edit command.

    Edit command of the Page tab

    Note    If the Edit command is disabled, you may not have the permissions to edit the page. Contact your administrator..

  2. Click the page where you want to insert a Current User Filter Web Part and a List View Web Part.

  3. In the ribbon, click the Insert tab, and then click Web Part.

    Web Part command

  4. Under Categories, click Lists and Libraries, under Web Parts, click the List View Web Part you want, and then click Add. The new Web Part appears on the page.

  5. Click the Web Part menu down arrow for the List View Web Part, and then point to Modify Shared Web Part.

  6. In the Web Part tool pane, edit the custom Web Part properties by doing the following:

    • To change the default view of the list, select a different view from the Selected View list box. For example, you may want to filter, sort, or group data a different way or display different columns. Alternatively, click Edit the current view to edit the current view of the list.

      Note    Whenever you select or edit a list view, a copy of the list design is made from the original site list design and saved with the List View Web Part. However, the list data remains the same.

      Be careful when you switch to a different view from the current view. You may delete changes that you made to the current view and may disable Web Part connections that depend on columns in the current view. You are prompted for confirmation if you switch views.

    • To change the toolbar, under ToolBar Type, select Full Toolbar, Summary Toolbar, or No Toolbar from the list box.

  7. At the bottom of the tool pane, click OK.

  8. Under Categories click Filters, under Web Parts click Current User, and then click Add. The new Choice Filter Web Part appears on the page.

  9. To configure the Web Part, do one of the following:

    • In the Web Part, click Open the tool pane.

    • Point to the Web Part, click the down arrow, and then click Edit Web Part. The configuration tool pane appears.

  10. In the tool pane, type a name in the Filter Name box to identify the Web Part.

    Tip    You can also use the name as a label or a brief instruction to the user. For example, you can use Filter Reports By: as a label to tell users they can filter the view of a Reports list.

  11. Under Select value to provide, do one of the following:

    • To filter by the user name, select Current user name.

    • To filter by another value in the current user's SharePoint profile, select SharePoint profile value for current user, and then select an item from the list box.

      The list box is populated with the list of all SharePoint profile properties that have a privacy policy of Everyone.

      Tip    An easy way to see a list of user profiles at your site is to display the MyProfile tab on My Site, and then edit the details.

  12. Optionally, in the Advanced Filter Options section, do one or more of the following:

    • To enable users to filter by a null value, select Send empty if there are no values. For example, you may want to see if a profile value for that user is not entered in the column.

    • To decide how to handle more than one value, under When handling multiple values, do one of the following: select Send only the first value to pass only one value by using the Web Part connection, select Send all values to pass two or more values by using the Web Part connection, or select Combine them into a single value and delimit with, and then enter one or more characters in the text box to pass two or more delimited values by using the Web Part connection.

    • To prefix a value to the Web Part property value to ensure a match to the column in the SharePoint list, enter text in the Text to insert before values text box.

    • To append a value at the end of the Web Part property value to ensure a match to the column in the SharePoint list, enter text in the Text to insert after values.

  13. To save your changes, at the bottom of the tool pane, click OK.

  14. To connect the Current User Filter Web Part, point to the Current User Filter Web Part, click the down arrow, point to Connections, point to Send Filter Values To, and then click the name of the List View Web Part to which you want to connect.

  15. In the Configure Connection dialog box, select the column that you want to filter in the List View Web Part, and then click Finish.

  16. When you are done configuring the connection, in the Pagetab, click Save & Close to save and view the page.

To dynamically change the results in the List View Web Part, just go to the page. because the Current User Filter Web Part automatically filters the information based on the user profile, no user input is required.

Top of Page

Connect a SharePoint List Filter Web Part to a List View Web Part

Note    The following procedure assumes you are creating a page on a team site. Commands and instructions can vary on other sites.

To edit a page you must have at least the permissions obtained by being added to the default <Site Name> Members SharePoint group for the site.

  1. From a page, in the ribbon click the Page tab, and then click the Edit command.

    Edit command of the Page tab

    Note    If the Edit command is disabled, you may not have the permissions to edit the page. Contact your administrator..

  2. Click the page where you want to insert a SharePoint List Filter Web Part and a List View Web Part.

  3. In the ribbon, click the Insert tab, and then click Web Part.

    Web Part command

  4. Under Categories, click Lists and Libraries, under Web Parts, click the List View Web Part you want, and then click Add. The new Web Part appears on the page.

  5. Click the Web Part menu down arrow for the List View Web Part, and then point to Modify Shared Web Part.

  6. In the Web Part tool pane, edit the custom Web Part properties by doing the following:

    • To change the default view of the list, select a different view from the Selected View list box. For example, you may want to filter, sort, or group data a different way or display different columns. Alternatively, click Edit the current view to edit the current view of the list.

      Note    Whenever you select or edit a list view, a copy of the list design is made from the original site list design and saved with the List View Web Part. However, the list data remains the same.

      Be careful when you switch to a different view from the current view. You may delete changes that you made to the current view and may disable Web Part connections that depend on columns in the current view. You are prompted for confirmation if you switch views.

    • To change the toolbar, under ToolBar Type, select Full Toolbar, Summary Toolbar, or No Toolbar from the list box.

  7. At the bottom of the tool pane, click OK.

  8. Under Categories click Filters, under Web Parts click SharePoint List Filter, and then click Add. The new Web Part appears on the page.

  9. To configure the Web Part, do one of the following:

    • In the Web Part, click Open the tool pane.

    • Point to the Web Part, click the down arrow, and then click Edit Web Part. The configuration tool pane appears.

  10. In the tool pane, type a name in the Filter Name box to identify the Web Part.

    Tip    You can also use the name as a label or a brief instruction to the user. For example, you can use Filter Reports By: as a label to tell users they can filter the view of a Reports list.

  11. To specify a SharePoint list, enter the URL of a list in the List box, or click Browse next to the text box and search for the list you want.

  12. Optionally, to select a different list view, select an item from the View list box. For example, you may want to filter, sort, or group data a different way or display different columns.

  13. Select a column from the Value field list box. The value column displays all supported columns from the list. Some columns are not supported, such as Title, Calculated, and Multiple lines of text.

    Important    When you make the connection between the SharePoint List Filter Web Part and the List View Web Part, make sure you choose a column that has matching values to the Value field property.

    Note    A SharePoint List Filter Web Part has a limit of 100 items.

  14. Optionally, select a column from the Description field list box. The description column is used to display an alternative value in the Select Filter Value(s) dialog box, which displays when a user clicks the Filter button. For example, if you have a Month number column that uses the numbers 1 though 12 as month values, you can use a Month Name column as the Description column so that January is displayed instead of 1, February instead of 2, and so on.

  15. Optionally, in the Advanced Filter Options section, do one or more of the following:

    • In the Control width in pixels text box, enter a number indicating the width of the text box as the number of pixels, or an empty value or "0" to automatically size the text box. Because the value entered by the user appears in this text box, you probably want to make it wide enough for the largest possible value.

    • To display a message that reminds the user to make a choice to filter the data, select the Require user to choose a value check box.

    • To enter an initial value in the SharePoint List Filter Web Part text box, enter a default value in the Default Value box, a value that typically matches one of the values in the column specified in step 13 or step 14. This default value is then used to display the initial list of values in the List View Web Part when the page first appears.

    • To enable users to filter by a null value, select "(Empty)" value. For example, users may want to see all values in a column that have no entry. To enable the clearing of a filter so that users can see all the values in the List View Web Part, select Allow Multiple selections.

      Note    The Select Filter Value(s) dialog box displays check boxes, rather than radio buttons.

      A user cannot use this feature to display the filtered results of two or more selections, because The List View Web Part does not support multiple selections. If a user chooses multiple selections, only the first selection is used.

  16. To save your changes, at the bottom of the tool pane, click OK.

  17. To connect the SharePoint List Filter Web Part, point to the SharePoint List Filter Web Part, click the down arrow, point to Connections, point to Send Filter Values To, and then click the name of the List View Web Part to which you want to connect.

  18. In the Configure Connection dialog box, select the column that you want to filter in the List View Web Part, and then click Finish.

  19. When you are done configuring the connection, in Page tab, click Save & Close to save and view the page

To dynamically change the results in the List View Web Part, in the SharePoint List Filter Web Part, click Filter, click a value, and then click OK. If you selected the Allow Multiple selections property, to redisplay all the values in the List View Web Part, you must clear all the check boxes, and then click OK.

Top of Page

Applies To: SharePoint Server 2010



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language