> 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

## 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 current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
