Delete records from a salesforce object using Azure data factory

Jiby Jacob 70 Reputation points
2024-05-06T16:57:11.73+00:00

Hi there,

I am working on a ADF pipeline that transforms data from salesforce and finally i need to delete some records from salesforce object. adf does not have a built in feature to delete and i was wondering if we can utilize lookup activity to run delete SOQL query to use web activity to run a delete API. Is there any better way to delete records from salesforce object using adf?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,010 questions
{count} vote

1 answer

Sort by: Most helpful
  1. phemanth 12,320 Reputation points Microsoft Vendor
    2024-05-07T12:05:52.6866667+00:00

    @Jiby Jacob

    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:

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.