- Newest
- Most votes
- Most comments
The issue you're experiencing with date filters in the AWS Glue Salesforce Connector is likely due to the specific format requirements for DateTime fields when using filters. For Salesforce Marketing Cloud connector (which may have similar requirements to the standard Salesforce connector), the correct format for DateTime fields in filters is "yyyy-mm-ddThh:MM:ssZ".
However, it seems you've already tried this format and encountered an error. Given that, here are a few suggestions to troubleshoot and resolve the issue:
-
Ensure that you're using single quotes around the date string in your filter predicate. Your example looks correct, but double-check this.
-
Try removing the time component and just use the date part: "FILTER_PREDICATE": "Status='Closed' AND ClosedDate = 2024-12-01"
-
If that doesn't work, you could try using a range instead of an exact date: "FILTER_PREDICATE": "Status='Closed' AND ClosedDate >= 2024-12-01 AND ClosedDate < 2024-12-02"
-
Another approach is to use Salesforce's date literals. For example: "FILTER_PREDICATE": "Status='Closed' AND ClosedDate = THIS_YEAR"
-
If you're trying to filter for a specific year, you could use the CALENDAR_YEAR() function: "FILTER_PREDICATE": "Status='Closed' AND CALENDAR_YEAR(ClosedDate) = 2024"
-
Lastly, you might want to check if the ClosedDate field in your Salesforce object is actually a DateTime field. If it's a Date field without a time component, that could explain some of the parsing issues.
If none of these solutions work, you may need to contact AWS support for further assistance, as there could be a specific issue with how the Glue Salesforce Connector is handling date filters in your particular setup.
Remember that when working with AWS Glue's Salesforce connector, it's crucial to use the correct field names as they appear in Salesforce, respecting case sensitivity. The connector translates your filter predicate into a SOQL query, so adhering to Salesforce's naming conventions is essential for successful data extraction and filtering.
Sources
AWS Glue: Salesforce connector. Filter data from object | AWS re:Post
Limitations and notes for Salesforce Marketing Cloud connector - AWS Glue
Here are all the variations and failure modes: Status='Closed' AND CALENDAR_YEAR(ClosedDate) = 2024 glue.spark.connector.exception.ValidationException: FunctionCallContext is not supported
Status='Closed' AND ClosedDate = 2024-12-01 ArithmeticBinaryContext is not supported.
Status='Closed' AND ClosedDate >= 2024-12-01 AND ClosedDate < 2024-12-02 ArithmeticBinaryContext is not supported.
Status='Closed' AND ClosedDate >= '2024-12-01' AND ClosedDate < '2024-12-02' Text '"2024-12-01"' could not be parsed at index 0
Status='Closed' AND ClosedDate = THIS_YEAR no viable alternative at input 'ClosedDate=THIS_YEAR' at com.amazonaws.appflow.custom.connector.queryfilter.CustomConnectorParseTreeBuilder
answered 2 years ago
In the Salesforce connector, try using the following syntax for the filter:
where LastModifiedDate > TIMESTAMP '2025-05-05 00:00:00 UTC'
I was able to test this using my SFDC developer account and the CASE entity/table.
Hope this helps!
answered a year ago
Relevant content
asked 2 years ago
asked 7 months ago
- AWS OFFICIALUpdated 2 years ago
