Skip to main content

Salesforce Delete by External ID

Overview

This documentation provides detailed information about the "Salesforce Delete by External ID" pipeline. This connector facilitates the deletion of records from Salesforce based on a unique External ID.

In Salesforce, besides the standard unique Salesforce record ID, you can define other fields as "External ID". These fields must also contain unique values and can be used to identify records, especially when integrating with external systems.

This pipeline is designed for scenarios where you need to delete records in Salesforce using such a custom unique field (External ID), rather than the standard Salesforce ID. The pipeline finds records in Salesforce by the specified External ID field, using the corresponding value from your Source Entity, and then deletes the matched records.

Pipeline Parameters

Name

This is the name of the pipeline. Example: Delete Accounts by EID

Salesforce Settings

This group contains settings specific to your Salesforce instance and the resources you intend to access.

Salesforce Object

  • Type: Variable
  • Description: The Salesforce object (e.g., Account, Investor_Agreement__c) from which records will be deleted.
  • How to find: You can find the API name of the available objects in your Salesforce instance by navigating to Setup > Object Manager.

Salesforce External ID Field

  • Type: Variable
  • Description: The API name of the field in the Salesforce Object that is designated as an External ID. This field will be used to match records from the Source Entity for deletion.

Salesforce External ID Value Mapping

  • Type: JSONata
  • Description: A JSONata expression that specifies how to extract the value for the Salesforce External ID Field from your Source Entity records. This extracted value will be used to find the matching record in Salesforce for deletion.
  • Configuration: Enter a JSONata expression.
  • Example: $.data.EID This means the pipeline will take the value from the EID field (located within the data object) of each relevant record in your Source Entity and use it to find a Salesforce record where the Salesforce External ID Field matches this EID value.

Source Entity Settings

Settings for the Source Entity in BuiltAPI that contains the External IDs of the Salesforce records you wish to delete.

Source Entity

  • Type: Entity
  • Description: The BuiltAPI entity that holds the records (or references) indicating which Salesforce records should be deleted. This entity must contain the External ID values that correspond to the Salesforce External ID Field.
  • Configuration: Select the appropriate entity from the dropdown menu.

Source Entity Only Updated

  • Type: Boolean
  • Description: If enabled (toggled on), the pipeline will only process records from the Source Entity that have been updated since the last successful run of this pipeline. If disabled, all records matching the filter will be processed.
  • Default: Typically enabled for ongoing synchronization.

Source Entity Filter

  • Type: JSON (Mongo Query)
  • Description: Defines conditions under which records from the Source Entity are selected for processing. Only records that match this filter will trigger a deletion attempt in Salesforce.
  • Configuration: Enter a Mongo query JSON object.
  • Example:
    {
    "data.is_deleted": true
    }
    This filter selects records from the Source Entity where the is_deleted field within the data object is true. The pipeline will then attempt to delete Salesforce records whose configured External ID matches the value obtained via Salesforce External ID Value Mapping from these selected source records.

Workflow

  1. The pipeline queries the Source Entity based on the Source Entity Filter (and considering the Source Entity Only Updated flag).
  2. For each record selected from the Source Entity, it extracts the External ID value using the Salesforce External ID Value Mapping (e.g., the EID value).
  3. It then searches in the specified Salesforce Object for a record where the field designated as Salesforce External ID Field has a value matching the extracted External ID.
  4. If a matching record is found in Salesforce, it is deleted.