> For the complete documentation index, see [llms.txt](https://help.delpha.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.delpha.io/delpha-for-salesforce/how-to-faq/delpha-duplicate/how-to-make-duplicate-records-exclusion-dynamic.md).

# How to make Duplicate Records exclusion dynamic

Learn to exclude Salesforce records from Delpha's duplicate detection using custom formula fields. Automate deduplication filters and improve accuracy.

## How to Dynamically Exclude Records from Duplicate Detection

#### Overview

In the article [How to exclude records from the analysis](/delpha-for-salesforce/how-to-faq/delpha-duplicate/how-to-exclude-records-from-the-analysis.md), we explained how to **statically** ignore records from Delpha’s duplicate detection using the `D Do Not Compare` checkbox.

This article shows how to take that a step further by creating a **dynamic exclusion rule** using a **custom formula field**. This lets you automatically exclude records based on business logic.

## Step-by-Step Guide

### **1. Create a Custom Formula Field (Boolean)**

1. Go to **Salesforce Setup** → **Object Manager**.
2. Select the object (e.g., Account, Contact, Lead).
3. Click on **Fields & Relationships** → **New** → choose **Formula** as the data type.
4. Select **Checkbox** as the return type.
5. Define your formula logic.

**Example:**\
To exclude Accounts with Record Type “Partner” or “Partner - Prospect”:

```salesforce
OR(ISPICKVAL(Type, "Partner"), ISPICKVAL(Type, "Partner - Prospect"))
```

### **2. Configure Delpha to Use Your Custom Field**

1. Open the **Delpha Setup** app.
2. Navigate to the **Duplicate Configuration** tab.
3. In the **Duplicate Criteria Settings** section, locate the field picker for `D Do Not Compare`.
4. Replace it with your **custom formula field**.

Once done, records where the formula evaluates to `TRUE` will be automatically excluded from the duplicate analysis.

## Why Use This?

* Allows **smart, dynamic filtering** of records.
* Saves **duplicate credits** by skipping records that don’t need to be compared.
* Fits evolving business logic without manual updates.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.delpha.io/delpha-for-salesforce/how-to-faq/delpha-duplicate/how-to-make-duplicate-records-exclusion-dynamic.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
