Override Automatic Filter on a Delta Export?
I am defining my custom filter criteria on a delta export for Salesforce data. I need to pull contacts that are either new or whos account has been updated since the last run. I am using the handlebars to support this and the Delta is the only way to get the Flow last export date.
With that said, the process automatically adds an additional filter to the end of the query on run time. The query in the flow:
Select Id, AccountId, Account.NS_Netsuite_Id__c, Email, Fax, Description, HomePhone, Phone, Title, MobilePhone, FirstName, LastName, MailingStreet, MailingCity, MailingState, MailingPostalCode, MailingCountry, NS_NetSuite_Id__c, NS_Send_as_test_record__c from Contact where (Account.NS_NetSuite_Id__c!=null) and NS_Skip_Export_To_NetSuite__c=false and (NOT LastModifiedBy.Name Like'%Netsuite%') and (Account.LastModifiedDate > {{lastExportDateTime}} or LastModifiedDate>{{lastExportDateTime}})
My query, I've defined the date filters. However, when I debug the connection I see the query as:
Select Id, AccountId, Account.NS_Netsuite_Id__c, Email, Fax, Description, HomePhone, Phone, Title, MobilePhone, FirstName, LastName, MailingStreet, MailingCity, MailingState, MailingPostalCode, MailingCountry, NS_NetSuite_Id__c, NS_Send_as_test_record__c from Contact where ( Account.NS_NetSuite_Id__c!=null ) and NS_Skip_Export_To_NetSuite__c=false and ( NOT LastModifiedBy.Name Like '%Netsuite%' ) and ( Account.LastModifiedDate > 2023-04-27T10:35:25.376Z or LastModifiedDate>2023-04-27T10:35:25.376Z ) and ((LastModifiedDate > 2023-04-27T10:35:25.376Z))
This has automatically added the bolded filter. Any way to prevent this?
Comments
Hi Damion,
When you select delta and select the fields via the drop down checklist IO is trying to help you by automatically adding the date filter on the SOQL statement which is why you see it appear in the debug. If you still want to explicitly write out your own where clause rather than use the UI based assist you can use {{data.lastExportDateTime}} instead of just {{lastExportDateTime}} and uncheck any of the boxes under the "date fields to use in delta" search box(see screenshot). With no boxes checked and the {{data.lastExportDateTime}} in the SOQL statement it will allow you to write your own and not add any additional where clauses.
Let me know if this works for you.
Please sign in to leave a comment.