# Filter which entries to synchronize

Abstract

How to use a query filter to limit the number of entries to synchronize to or from Sitecore.

When you use a Data Exchange Framework (DEF) tool, such as Sitecore Connect for Salesforce CRM, to synchronize entries between a provider and xConnect, you can add a filter that limits which entries are included in the synchronization.

DEF adds the filters to the query it uses to select the entries for synchronization. You can therefore use filters to optimize the synchronization by limiting the number of entries the connector processes.

In addition to the filters provided in DEF, you can create custom filter expressions.

To add a filter to a pipeline:

1. In the Content Editor, navigate to the connector tenant. Navigate to the pipeline you want to modify. Navigate to the pipeline step that reads the entries.

For example, if you use the Sitecore Connect for Salesforce CRM connector to synchronize contacts, navigate to Data Exchange\[salesforce tenant]\Pipelines\Salesforce Campaigns to xConnect Sync Pipelines\Read Contacts from Salesforce Pipeline\Read Contacts from Salesforce.

2. On the Content tab, in the Filter Expressions field, select the filter you want to apply to the synchronization.

### Note

In some pipeline steps, the field where you select the filter can have a name other than Filter Expressions. However, the name usually includes the word Filter.

3. Save the item.

Data Exchange Framework contains a number of default filter expressions.

To add your own custom filter expression to a tenant:

1. In the Content Editor, navigate to /sitecore/system/Data Exchange/<tenant>/Tenant Settings/Providers/xConnect/Filter Expressions/Contact Filter Expressions.

2. To add a new contact filter, right-click Contact Filter Expressions, click Insert, and then click Filter expression.

3. Navigate to the new filter. On the Content tab, in the Logical Operator field, click the logical operator you want to use to chain filter conditions together.

4. Right-click the filter expression you created. In the Insert menu, click the condition you want to add to the filter.

5. In the Content Tree, select the condition you just created. On the Content tab, specify the filter conditions. The filter type determines which conditions are available.

6. Save the item.