Source Filter

Source Filter

Overview

The Source Filter feature allows you to control which records are imported from Salesforce by applying SOQL WHERE clauses to your object queries. This helps you:

  • Import only the data you need, reducing sync time and storage requirements

  • Filter records based on specific criteria (e.g., active records only, recent data, specific departments)

  • Define separate filters for each Salesforce object independently

  • Improve import performance by reducing the volume of data transferred

 

How to Access

Navigate to the Source Filter tab in the admin interface of the Salesforce Importer application.

 

Configuration Steps

  1. Click "Set Filters" to display the filter configuration form

  2. You will see a list of all Salesforce objects that are currently enabled for import

  3. For each object, enter a SOQL WHERE clause condition (without the WHERE keyword)

  4. Click Save to apply the filter for that specific object

  5. To clear a filter, delete the text and save (leaving it empty will import all records)

 

Filter Examples

Example 1: Filter by Industry

Industry = 'Technology'

This will import only Account records where the Industry field is 'Technology'.

 

Example 2: Filter by Date

CreatedDate > 2024-01-01T00:00:00Z

This will import only records created after January 1, 2024.

 

Example 3: Multiple Conditions

IsActive = true AND Department = 'Sales'

This will import only active records from the Sales department.

 

Example 4: Pattern Matching

Name LIKE '%Corp%'

This will import only records where the Name contains 'Corp'.

 

Example 5: Null Checks

Email != null

This will import only records that have an email address.

 

Important Notes

Syntax Requirements

  • Do NOT include the WHERE keyword - it is automatically added by the system

  • Use valid SOQL syntax - invalid filters may cause import failures

  • String values must be enclosed in single quotes (e.g., 'Technology')

  • Date and datetime values should use ISO 8601 format

  • Field names are case-sensitive and must match your Salesforce schema

 

Supported Operators

SOQL WHERE clauses support various operators including:

  • Comparison: =, !=, <, <=, >, >=

  • Logical: AND, OR, NOT

  • Pattern Matching: LIKE (with % wildcard)

  • Set Membership: IN, NOT IN

  • Null Checks: = null, != null

 

Best Practices

  • Test your filters: Verify your SOQL syntax in Salesforce Developer Console before applying it in the importer

  • Start simple: Begin with basic filters and add complexity as needed

  • Monitor imports: Check import logs to ensure filters are working as expected

  • Document your filters: Keep track of what filters you've applied and why

  • Use indexed fields: For better performance, filter on indexed Salesforce fields when possible

 

Additional Resources

For detailed information about SOQL WHERE clause syntax, operators, and functions, refer to the official Salesforce SOQL documentation.