Usage Topics: Creating Filters

Contains vs. Is Equal To

Because SharePoint sometimes stores data differently than the way it is displayed, you may find that you get better results from your filters when you use the "Contains" operator instead of the "Is Equal To" operator.

For example, you may see the name "Bob Smith" in a view that includes the Assigned To field. However, SharePoint stores this name with extra characters, so the actual stored value may be something like "3;#Bob Smith." Therefore, if you want to filter on records that were assigned to Bob, you get the desired results if you build the filter with the "Contains" operator.

Available Fields for Building a Filter

You can only build a filter based on the fields you mapped in Step 2 (Select Lists and Map Fields). This is more obvious when the Filter User Interface (Filter Builder) is enabled, because only the fields you mapped will be listed in the Field drop-down on the Define Filters screen. If the Filter User Interface is not enabled, you will be allowed to manually build a filter based on a field that you did not map, but your filter (Step 4: Define Data Transfer) will not yield any results.

It is also important to note that the Data Publisher does not support calculated fields. Again, this is more apparent when the Filter User Interface is enabled, because calculated fields cannot be mapped and therefore will not be listed in the Field drop-down. This is something to keep in mind if you manually build a filter.

Using "Or-New" and "And-New"

This point only applies if the Filter User Interface is turned on.

If you want to create a filter that is based on more than one field or one value, click Add Another Filter below the Value field to display an additional set of entry fields, preceded by the And/Or field.

If you only want to filter on two fields or values, the process to build the filter is straightforward. Simply select "And" or "Or" from the And/Or field and continue to define your filter. However, if you want to filter on three or more fields or values, you may want to write down what you want to do before you begin entering your criteria. Understanding the way the "And-New" and "Or-New" options work makes should explain why:

      And-New: Filters on records that meet both criteria and treat the next criteria as if it was in a new set of parentheses.

      Or-New: Filters on records that meet either criteria and treat the next criteria as if it was in a new set of parentheses.

In addition, because of the way the Data Publisher processes filter expressions, it is important that you place grouped items at the beginning of the expression and single items at the end. For example, say you want to filter on contact records where the contact's job title is Purchasing Manager and the state is either Florida or Georgia. You would group the two state values together and put the job title section at the end of the expression. If you wrote out the expression, it would look like this:
(([State] = 'FL') OR ([State] = 'GA')) AND ([Job Title] LIKE 'Purchasing Manager')

If you used the Filter User Interface (Filter Builder), you would perform these steps to build the filter:

1.  Set the Field to State.

2.  Set When to Is Equal To.

3.  Type FL in the Value field.

4.  Click Add Another Filter.

5.  Select Or from the And/Or field.

6.  Set the Field to State.

7.  Set When to Is Equal To.

8.  Type GA in the Value field.

9.  Click Add Another Filter.

10. Select And-New from the And/Or field.

11. Set the Field to Job Title.

12. Set When to Contains.

13. Type Purchasing Manager in the Value field.

14. Click Store Settings when you are finished.