Add a filter
When designing a form, you can allow users to filter data in a repeating section or repeating table, based on values that the user enters or selects elsewhere on the form. For example, if you use a repeating table to collect information about current projects, you can design a list box that allows users to filter projects by status.
Note To complete this procedure, your form must include both a control that filters data (typically a list box control) and a control that displays the filtered data (a repeating section or repeating table).
- Right-click the Repeating Table or Repeating Section label below the table or section on the form, and then click Control Properties on the shortcut menu.
- On the Display tab in the Control Properties dialog box, click Filter Data.
- In the Filter Data dialog box, click Add.
Note If you want to add a condition to an existing filter, click the filter that you want, and then click Modify.
- In the Specify Filter Conditions dialog box, enter the filter condition.
The following example demonstrates how to design a filter that allows users to show only the rows in a repeating table that match the values in a list box. It also demonstrates how to give users a "Show All" option in the list box so that they can see all the data in the repeating table.
For the purposes of this example, imagine that you created an Assigned to list that filters data in a repeating table. You can manually create list entries, including a default entry with the display name and value of Show All. This entry appears as the default choice in the Assigned to list when users fill out the form.
In the boxes under Display data that meets the following conditions, you can create a filter such as the following.
Box 1 Box 2 Box 3 Box 4 Name_text_box is equal to Assigned_To_list_box_filter or Assigned_To_list_box_filter contains "Show All" In this example:
- Name_text_box is the Name text box inside the repeating table.
- Assigned_To_list_box_filter is the Assigned to list box.
- "Show All" is the default item in the list box. (When you type Show All in box 3, don't include the quotation marks; they are added automatically when you move the insertion point away from the box.)
Note Microsoft Office InfoPath 2003 verifies a condition by checking the value of the field that is bound to the control inside the repeating table or repeating section, not the control itself.
- To add additional filter conditions, click And, and then in the rightmost box, do one of the following:
- To apply the filter only when both conditions are true, click and.
- To apply the filter when one or both of the conditions are true, click or.
Notes
- When users move their mouse pointer over rows or sections that have been filtered, a filter icon appears on the shortcut menu button for each row or section. This provides users with a hint that their data is filtered and also allows them to reapply the filter, if necessary. If you don't want users to see the filter-specific shortcut menu button, clear the Show filter icon to indicate filtered items check box in the properties dialog box for the repeating table or repeating section.
- The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more