Configuring Merge Rules

Last updated

Define how Plauti Deduplicate picks the master record, and which field values it keeps in a merge, using stacked rules, field groups and merge rule sets.

The full range of Merge Rules as described below is available in our Premium and PDM editions. If you don't have a Premium or PDM subscription, feel free to apply for a trial.

This article describes how to configure the different merge rules. Read more in depth about how the merge rules work in Merging Records with Merge Rules.

Accessing the Merge Rules

The merge rules are configured per Object, in Deduplicate Setup.

  1. In Plauti Deduplicate, go to Deduplicate Setup.
  2. At left, go to Object Configuration, and click Configure at the Object you want to configure merge rules for.
  3. Go to tab Merge Rules.

An overview opens of the Merge Rule Sets of the object.

AI Merge Recommendation

Click AI Recommendation Fields to set which fields can use AI to come up with merge suggestions. This setting applies to all Merge Rule Sets of the object. Read more in AI Merge Recommendation.

Configuring a Merge Rule Set

An object always has a Default Merge Rules set preconfigured, which can be used as-is or edited to your needs. You can clone an existing Merge Rule Set to use it as a starting point for a similar set, or create a fully new one.

  1. In the overview of merge rule sets:
    • To create a new merge rule set from scratch, click + New Merge Rule Set at top right.
    • To base a new merge rule set on an existing set, open the Action menu at the right of the existing set and click Clone.
    • To configure the settings, master record rule, field groups and field rules of an existing merge rule set, click the merge rule set's name.
  2. In the 'Merge Rule Set Configuration' section of the page that opens, click Configure.
    This option is disabled for the Default Merge Rules set, but if you scroll down the different rules can be edited and added to.
  3. At Name, enter a clear name for the merge rule set.
  4. At Description, explain the purpose of the merge rule set to other administrators (optional but recommended).
  5. When you want to start using the merge rule set, toggle Active to Active.
  6. At Priority, enter a priority number from 1 to 99. Make sure the number is unique for all merge rule sets of this object.
    Merge rule sets are evaluated based on this priority number, with 1 being evaluated first. The first rules set that matches for all records in a duplicate record group is applied.
    Give more specific merge rule sets a priority number closer to 1 than broader ones, so they are evaluated first. The Default Merge Rules set has priority 100 and is therefore always evaluated last.
  7. At Formula, enter a Salesforce formula that returns a Boolean (true or false), using field API names. Then click outside the formula field to validate the formula.
    The merge rule set applies if the formula evaluates to 'true' for all records in the duplicate group. Unsupported parameters are flagged on validation.
    To have a merge rule set always apply to all records of an object, enter a formula that applies to all records, for example CreatedDate > DATETIMEVALUE("1970-01-01 00:00:00") . Such a merge rule set will be evaluated before the Default Merge Rules set because of its priority number.
  8. Click Save.

Formula examples

To search case insensitive: UPPER(FirstName) = "JOHN"

To apply the merge rule set to all records with Name: Acme Corp and Billing Country: the Netherlands: Name = "Acme Corp" && BillingCountry = "NL"

To apply the merge rule set to all records with Lead source: Web or an annual revenue of more than 100.000: ISPICKVAL(LeadSource, "Web") || AnnualRevenue > 100000

For very complex logic, or to use fields of a related record other than Id or Name, create a Salesforce formula field on the object and reference that field in the formula.

Activating a Merge Rule Set

Merge Rule Sets that are marked as 'Inactive' in the Merge Rule Set overview will not be applied during a merge. To activate a merge rule set:

  • At the right of the merge rule set, open its Action menu and click Activate.
    Or,
  • Click the name of the merge rule set > In the Merge Rule Set Configuration section, click Configure > In the Edit Merge Rule Set pop-up that opens, toggle to Active > Click Save.

Disabling a Merge Rule Set is done in the same way. Note that the Default Merge Rules set cannot be disabled.

Adding Follow-up Rules

➡ Read more in Merging Records with Merge Rules - Stacked rules and the Tiebreaker.

Some of the master record rules and field (group) rules can't always pick a single winning record or value straight away, if several records or values can match the rule. For these cases, you can configure follow-up rules. Ended with a tiebreaker rule, the merge rules will always result in only one winning record or value.

In the 'Rules' overviews below, each rule type indicates in the 'Allows for follow-up rule' column whether you can add another rule after it. If it states 'No', the rule will function as a Tiebreaker rule for the rules above it. Rule types that do allow for a follow-up rule always need a Tiebreaker rule as the last rule, to guarantee ending up with one winning record or value.

To add another rule, click +Add Rule bottom right. If this option is not available, no more rules can be added. Any new rule will always be placed before the Tiebreaker rule.

Rules are applied based on their numbering, starting with 'Merge Rule 1'. To move rules up or down the list, use the Move Rule Up and Move Rule Down arrow buttons. Click the Remove Rule bin icon to delete a rule from the list.

Applies to

Every rule below the first rule has an 'Applies to' setting that controls which records the rule evaluates. The first rule is always applied to the whole duplicate group. For the next rules you can decide to only consider the records that remain after the rules above it have been applied ('Records selected by previous rule'), or to return to all records of the duplicate group, including records that were eliminated by the rules above them ('All records').

A rule set to 'All records' discards the narrowing done by the rules above it. If the first rule in a stack protects a category of records, a later rule set to All records can bring the excluded records back into contention. Use 'Records selected by previous rule', unless you specifically want eliminated records to become eligible again.

Master Record Rule

To configure the Master Record Rule:

  1. On a Merge Rule Set page, scroll to the 'Master Record Rule' section and click Edit Master Record Rule.
  2. At Master Rule, select one of the options listed below.
  3. If needed, and if possible, click +Add Rule at bottom right to add a follow-up rule.
  4. If needed, configure the Tiebreaker rule that appears.
  5. At Manual Master Selection, toggle to allow or disallow end users working with the manual merge page to select a different master record than the one selected by the Master Record Rule.
  6. Click Save.

The Master Record Rule section now displays the new settings.

Master Record Rule Description Allows for follow-up rule
Modified Date: Least Recent The record modified least recently will be the master record. No
Modified Date: Most Recent The record modified most recently will be the master record. No
Created Date: Least Recent The record created least recently will be the master record. No
Created Date: Most Recent The record created most recently will be the master record. No
Value Based The master record is determined based on a field, and a given field value such as "equal to 1" or "starts with C".
Select a field, and then a field expression and field value.
Yes
Field Based The master record is determined based on a field, and a field rule such as "shortest value" or "longest value".
Select a field, and then a field rule. Available field rule types depend on the field type.
Yes
Record that has the most fields populated The record with the highest number of populated fields will be the master record. Yes
Record with most attachments The record with the largest number of attachments will be the master record. Yes
Portal User The record that is linked to a Portal User will be the master record.
Available for the Contact and Person Account objects.
Yes

Field Group Rules

To configure a Field Group with a Field Rule:

  1. On a Merge Rule Set page, scroll to the 'Field Groups' section.
  2. Create or edit a Field Group:
    • To add a new Field Group, click Add Field Group. Enter a name for the group.
    • To edit an existing Field Group, click the Field Group's name.
  3. At Selected Fields, choose at least two fields to add to the field group. Add more fields by clicking + Add field at right.
  4. At Merge Rule 1, select one of the rules listed below. Which rules are available depends on the selected fields.
  5. If needed, and if possible, click +Add Rule at bottom right to add a follow-up rule.
  6. If needed, configure the Tiebreaker rule that appears.
  7. At Allow Blank, toggle to allow or disallow an empty group as the winning field group.
    For field groups, "Allow Blank" is set on the group, not on the individual fields in the group. A group with only part of the fields empty, for example a partially-filled address with a city and zip code filled in but no street, is considered to be not empty.
  8. Click Save.

The Field Group section now displays the new settings. Fold open the group if you don't see all its details right away.

Field Group Rule Description Allows for follow-up rule
Master Record Rule The field group of the record selected by the master record rule will be kept in the master record. No
Field Based The field group values to be kept in the master record are determined based on a field, and a field rule such as "shortest value" or "longest value".
Select a field, and then a field rule.
The selected field does not need to be in the field group. Available field rule types depend on the selected field type.
Yes
Value Based The field group values to be kept in the master record are determined based on a field, and a given field value such as "equal to 1" or "starts with C".
Select a field, and then a field expression and field value.
The selected field does not need to be in the field group. Available field expressions depend on the selected field type.
Yes
Group with the most populated fields The field group with the largest number of populated fields will be the group kept in the master record. Yes
Keep All Values All loser records' field group values are stored in a second field. After selecting this option, configure the details:
- Merge rule for deciding the value in the Master Record
Select a rule that decides which values are kept in the field group of the master record.
- Store additional values in (Long) Text Area
Select a long text area field for storing the field group values of the loser records.
- Values to store
Unique Values - Will only store values in the mapped long text area field that differ from those kept in the master record.
All Values - Will store all values, regardless of whether they are duplicate to the values kept in the master record.
- Delimiter
Choose a delimiter to separate the values in the long text area.
No
Divide Values All values from the master and loser record field groups are divided over the fields in the group in the master record. Any additional field values are stored in a separate long text area field. After selecting this option, configure the details:
- Store additional values in (Long) Text Area
Select a long text area field for storing the additional field values that can't be stored in the fields in the field group due to a possible surplus.
- Delimiter
Choose a delimiter to separate the values in the long text area.
No
Created Date: Least Recent The field group of the record created least recently will be the group kept in the master record. No
Created Date: Most Recent The field group of the record created most recently will be the group kept in the master record. No
Modified Date: Least Recent The field group of the record modified least recently will be the group kept in the master record. No
Modified Date: Most Recent The field group of the record modified most recently will be the group kept in the master record. No

Field Rules

To configure a Field Rule:

  1. On a Merge Rule Set page, scroll to the 'Configure Merge Rules' section.
  2. Create or edit a Field Group:
    • To add a new Field Merge Rule, click Configure Field Rule.
    • Click an existing Field Merge Rule's name to edit that Field Merge Rule.
  3. At Merge Rule 1, select one of the rules listed below. Which rules are available depends on the field. For a number of rules, such as 'Concatenate Values', 'Keep All Values', and 'Most Common Value', first select 'Field Based'.
    Read-only fields can only have 'Master Record Rule' or 'Keep All Values'.
  4. If needed, and if possible, click +Add Rule at bottom right to add a follow-up rule.
  5. If needed, configure the Tiebreaker rule that appears.
  6. At Allow Blank, toggle to allow or disallow an empty field as the winning field value.
  7. Click Save.

The Configure Merge Rules section now displays the new settings. Fold open a rule if you don't see all its details right away.

Field Rule Description Allows for follow-up rule
Master Record Rule The value of the record selected in the master record rule is kept in the master record. No
Modified Date: Least Recent The value of the record modified least recently is kept in the master record. No
Modified Date: Most Recent The value of the record modified most recently is kept in the master record. No
Created Date: Least Recent The value of the record created least recently is kept in the master record. No
Created Date: Most Recent The value of the record created most recently is kept in the master record. No
Value Based The field value to be kept in the master record is determined based on a field, and a given field value such as "equal to 1" or "starts with C".
Select a field, and then a field expression and field value.
Available field expressions depend on the selected field type.
Yes
Field Based Select a different field at Field:
The field value to be kept in the master record is determined based on a field, and a field rule such as "shortest value" or "longest value".
Select a field, and then a field rule.
Available field rules depend on the selected field type.
---
Select the same field at Field that the merge rule is for:
At the Field Rule field, select one of the rules listed below. Available field rules depend on the selected field type.
Yes
Group that has the most fields populated The group of fields, such as Address, with the most populated fields is kept in the master record.
Available for compound fields such as Address.
Yes
Most Common Value The value most common in the group of records is kept in the master record.
Please note that null values are not considered in this rule.
Available for field types: Text, Text Area, Email, Phone, URL, Picklist, Currency, Geolocation, Number, Checkbox, Date, Date & Time, Time.
Yes
Concatenate Values Combines the values of the master and loser records in the same field. After selecting this option, configure the details:
- Concatenate
Unique Values - The value in the loser record(s) is compared with the value in the master record. Only if the loser record(s) value differs from the master record is it concatenated in the field.
All Values - All values from the loser records are concatenated in the field, even if the value is duplicate.
- Delimiter
Choose a delimiter to separate the values in the long text area.
- Available for field types: Text, Text Area.
No
Keep All Values Keep all values of a specific field by storing values from the loser records in a secondary long text area. After selecting this option, configure the details:
- Merge rule for deciding the value in the Master Record
Pick a rule that decides which value is kept in the master record.
- Store additional values in (Long) Text Area
Select a Long Text Area field for storing the additional values.
- Values to store
Unique Values - Will only store values in the mapped long text area field that differ from the value kept in the master record.
All Values - Will store all values, regardless of whether they are duplicates to the value kept in the master record.
- Delimiter
Choose a delimiter to separate the values in the long text area.
- Available for field types: Address, Currency, Email, Geolocation, ID Lookup, Number, Phone, Picklist, Text, Text Area, URL.
Yes
Shortest Value The value with the smallest amount of characters will be kept in the master record. If there are two or more values with the same number of characters, the follow-up rule will be applied.
- Available for field types: Text, Text Area, Email, Phone, URL, Picklist.
Yes
Longest Value The value with the largest amount of characters will be kept in the master record. If there are two or more values with the same number of characters, the follow-up rule will be applied.
- Available for field types: Text, Text Area, Email, Phone, URL, Picklist.
Yes
Highest in Picklist Order The highest value in a picklist order selected in any of the records is kept in the master record.
- Available for field types: Picklists.
No
Lowest in Picklist Order The lowest value in a picklist order selected in any of the records is kept in the master record.
- Available for field types: Picklists.
No
Minimum Value The minimum value is kept in the master record.
- Available for field types: Number, Percent, Currency.
No
Maximum Value The maximum value is kept in the master record.
- Available for field types: Number, Percent, Currency.
No
Sum Sums all values and stores the summed-up value in the master record.
- Available for field types: Number, Currency.
No
Average Takes the average of all values and stores the average value in the master record.
- Available for field types: Number, Currency, Percent.
No
Multiply Multiplies all values and stores the multiplied value in the master record.
- Available for field types: Number, Currency.
No
Subtract Sets all values from high to low and subtracts the values. The resulting value is stored in the master record.
E.g., If record A has a value of 12, Record B has a value of 23, and record C has a value of 40, the resulting value is 40 - 23 - 12 = 5.
- Available for field types: Number, Currency.
No
True over False Will keep a "true" value in the master record if it can be found in the records.
- Available for field type: Checkbox.
No
False over True Will keep a "false" value in the master record if it can be found in the records.
- Available for field type: Checkbox.
No
Combine Values Combines all values from a multi-select picklist that can be found in the records into the master record's picklist.
- Available for field type: Multi-select Picklist.
No
Most Recent Value Will keep the most recent value in the master record.
- Available for field types: Date, Date & Time, Time, ID.
No
Least Recent Value Will keep the least recent value in the master record.
- Available for field type: Date, Date & Time, Time, ID.
No

Applies To

Follow-up Rule or Tiebreaker Applies To Description
All Records The follow-up rule will take all records in the duplicate group into account to determine the winner record or value.
Records selected by Initial Rule The follow-up rule will only apply to records or values that meet the criteria of the initial rule.

If you want to create rules that are more complex than what you can configure in the Merge Rules, for example if you want to use fields of a different Object, have a look at our Merge Plugins‍. Use a Merge Plugin to execute custom Apex code before or right after a merge operation is done. Merge Plugins & Merge Rules can work together perfectly well.