Target Records Filter.


This feature allows you to filter out unwanted target data just before sending them to the Target.

Feature overview.

Sometimes your query fetches from the Source extra records, that you don't want to export into the Target, but you not able to filter these records out directly using WHERE clause.

For example you want exclude all records coming from the CSV file that have null in the certain CSV column. For the CSV import, for example, the SOQL query is used only to define columns to process, but the WHERE clause of the SOQL is ignored.

In those cases you have the additional option to filter records called the Target Record Filter feature.

The following example will exclde all records that has no Account__c value.

{
    "query" : "SELECT Id, Name, Account__c FROM MyObject__c",
    ....
    "targetRecordsFilter" : "Account__c"

}

The following example will include only the records with empty Account__c  value.

{
 "query" : "SELECT Id, Name, Account__c FROM MyObject__c",
 ....
 "targetRecordsFilter" : "NOT Account__c"
}

The example to include only the records where field values are equal and Contact__c is not null:

{
 "query" : "SELECT Id, Name, Account__c, Account2__c, Contact__c FROM MyObject__c",
 ....
 "targetRecordsFilter" : "Account__c = Account2__c AND Contact__c"
}

The targetRecordsFilter uses regular SOQL syntax with these exceptions (the examples above):

  • When you want to select only records with field Account__c != null, you must write "Account__c" instead of "Account__c != null" as per the SOQL syntax.

  • In opposite if you want to select records with Account__c = null you just write "NOT Account__c" instead of "ParentId = null" as per the SOQL syntax.

Last updated on 13th Nov 2023