Skip to main content

Data Source Filter

The Data Source Filter feature in Data Sync allows you to filter your source data to include or exclude specific rows based on a C# code expression.

You can use the filter button in the data source toolbar or the filter box at the bottom of the data source window to apply a filter.

Filter Function

When you click the filter button, a syntax editor with intellisense will appear to help you write the correct filter syntax. Once you've entered your expression, click OK to apply the filter.

Filter Syntax Editor

The filter expression must return True to include the row in the results, otherwise return False to exclude it.

info

The filter will only be applied to data previewed from the schema map. Using the preview button on the data source will still return all the records.

You can also write filters directly into the Dynamic Columns base class using the BeginRow() method. The below image shows a filter added using the filter function:

Data Filter Example

Which you could also write directly into Dynamic Columns, which would look like this:

public override bool BeginRow()
{
return Lookup1_CategoryName != "Condiments" && UnitsInStock > 10;
}

To edit a filter, you can either edit the expression in the filter box or click the filter button to open the syntax editor.

If you want to delete all target rows in your project, you can simply enter a 0 in the filter box to exclude all source rows.

Server Side Filtering

While the Data Source Filter is useful for quick filtering of small data sets, it is not recommended for larger data sets as it can slow down the process and cause performance issues.

Instead, for larger data sets, consider using a server-side filter through the connection properties. This will help prevent the entire set of row data from being returned from the target data source and only filter the required data.

For example, if your Data Source is a SQL table, SharePoint list, Dynamics CRM entity, etc., you can use one of the following server-side filtering options:

  • SQL Where clause to filter data on the database server.
  • SharePoint view or CAML query to filter data on the SharePoint server.
  • Fetch XML filter expression to filter data on the Dynamics CRM server.

By using these server-side filtering options, you can significantly improve performance and avoid potential performance issues that can arise from using the client-side Data Source Filter.