Skip to content

AWS Glue: Salesforce connector. Filter data from object

0

I try to extract from Salesforce Lead, but i need to filter them using lastmodifieddate. I try to insert: leads = glueContext.create_dynamic_frame.from_options(connection_type="salesforce", connection_options={"API_VERSION": "v60.0", "connectionName": "Salesforce connection", "FILTER_PREDICATE": "lastmodifieddate>'2024-11-11'", "SELECTED_FIELDS": "Id,CreatedDate,LastModifiedDate", "ENTITY_NAME": "Lead"}, transformation_ctx="leads")

but I obtain this error:

Glue connector returned validation exception. The field that you specified as a filter, lastmodifieddate, is not supported by the data object that you assigned to this flow. Specify a valid field and try again.

asked 2 years ago741 views

2 Answers
0

The error you're encountering suggests that the field name "lastmodifieddate" is not recognized by the Salesforce connector in AWS Glue. This could be due to a case sensitivity issue or an incorrect field name. In Salesforce, the correct field name for the last modified date is typically "LastModifiedDate" with capital letters.

To resolve this issue, try modifying your filter predicate to use the correct case:

"FILTER_PREDICATE": "LastModifiedDate > '2024-11-11'"

Additionally, ensure that the date format in your filter matches the expected format for Salesforce SOQL queries. You might want to use the ISO 8601 format:

"FILTER_PREDICATE": "LastModifiedDate > 2024-11-11T00:00:00Z"

If you're still encountering issues, double-check that the "Lead" object in your Salesforce instance has the "LastModifiedDate" field available and that your connection has the necessary permissions to access it.

Remember that when working with AWS Glue's Salesforce connector, it's important 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 crucial for successful data extraction and filtering.
Sources
AWS Glue now supports native SaaS connectivity: Salesforce connector available now - AWS
Creating connections for connectors - AWS Glue
Filter - AWS Glue

answered 2 years ago

AWS
SUPPORT ENGINEER

reviewed 2 years ago

0

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!

AWS

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.