Thanks for using MS Q&A platform and posting your query.
No, Azure Data Factory (ADF) currently doesn't offer a built-in functionality to directly delete Salesforce records. However, there are two workarounds you mentioned that can achieve this:
Lookup Activity with SOQL and Web Activity with Delete API:
This approach is valid. You can use a Lookup activity to query Salesforce using SOQL (Salesforce Object Query Language) and retrieve the IDs of the records you want to delete. Then, chain a Web Activity to the Lookup activity. Configure the Web Activity to use the DELETE method on the Salesforce REST API endpoint for the specific object, passing the retrieved record IDs in the request body.
Salesforce Data Loader:
While not directly within ADF, you can leverage the Salesforce Data Loader as an external tool. Create a separate Data Loader task specifically for deleting records. You can define the deletion logic within the Data Loader based on specific criteria. This approach keeps your data transformation logic within ADF and uses the dedicated Salesforce tool for deletions.
Here's a breakdown of the pros and cons of each approach:
Lookup Activity + Web Activity:
- Pros: Integrates within your existing ADF pipeline.
- Cons: Requires additional configuration for both Lookup and Web activities. Might be less efficient for large-scale deletions due to multiple API calls.
Salesforce Data Loader:
- Pros: Potentially more efficient for bulk deletions. Easier to manage and schedule deletion tasks.
- Cons: Introduces an external tool into your workflow. Requires separate configuration and scheduling for the Data Loader task.
Unfortunately, there aren't any native ADF functionalities for record deletion in Salesforce at this time. However, you can keep an eye on future updates from Microsoft. They might introduce deletion capabilities in the Salesforce connector for ADF.
Here are some resources that you might find helpful:
- DELETE a Record in Salesforce REST API: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_delete_record.htm
- Salesforce Data Loader: https://dataloader.io/ Hope this helps. Do let us know if you any further queries.