When creating Import, Export or Replication tasks, you can specify filter settings to filter data being exported or replicated. You may filter data not only by exported fields but by any of the fields of exported object and objects it refers.
Note that filtering is not supported for importing data from CSV files.
The filter consists of conditions and condition groups.
Condition group is several conditions or nested condition groups united by a logical operator. Nested condition groups can contain their own nested condition groups and so on. Filter starts from the root condition group, to which you may add conditions or other groups.
Condition is a logical expression that compares a field of an exported object or one of the objects it references with a specified constant, or checks whether the field is/is not null.
To add a condition to a condition group, click the Add Condition button to the right of the group logical operator. After this in the first drop-down list select the name of the exported object or a reference to a related object to filter data by its field (for Export packages only). For Replication packages, filtering is performed only by exported object fields, so you don't need to select anything in the first drop-down list.
In the second drop-down list select the name of the field to filter the data by. In the third drop-down list select the comparison operator of the condition. And finally in the rightmost box specify the constant to compare the field to.
To add a condition group, click the Add Group button to the right of the parent group logical operator, then select the group logical operator - And, Or, or Xor. After this you can add conditions and condition groups to the new connection group.
To remove a condition or a group from the filter, click the Remove button in the line of the corresponding condition or group.
For example, we want to export Salesforce pricebooks that are active (IsActive = true) or recently modified, and that were created by a user, having "John" in his Name field. For such a filter we need to do the following:
|1.||The root condition group should stay with the And logical operator. So, just click Add Group to create a nested condition group. |
|2.||In the newly created condition group, select Or in the operator drop-down list. |
|3.||Click the Add Condition button of the new condition group. |
|4.||In the created condition, select Pricebook2 in the first drop-down list.|
|5.||Select IsActive in the second drop-down list.|
|6.||Select equals in the third drop-down list.|
|7.||Select True in the last drop-down list. |
|8.||Click the Add Condition button of the new condition group.|
|9.||In the created condition, select Pricebook2 in the first drop-down list.|
|10.|| Select LastModifiedDate in the second drop-down list.|
|11.|| Select >= in the third drop-down list.|
|12.|| Click the right-most box of this condition and choose the appropriate date using the opened calendar box. |
|13.|| After this we will add a condition, filtering pricebooks by the name of the user, who created them. Click the Add Condition button of the root condition group.|
|14.|| In the created condition, select CreatedBy in the first drop-down list.|
|15.|| Select Name in the second drop-down list.|
|16.|| Select like in the third drop-down list.|
|17.|| Enter "John" to the right-most box of this condition. |
|18.|| Now your filter is ready. It should look like this:|