A Master Record rule determines which record will be retained after a merge. 


Good to know: Losing records will be deleted from Salesforce as part of the merge process.


Master Record rules work based on the creation of ranking criteria that sorts duplicate records.  You can also create exception through the "prioritize record if" option.

 

Our recommended approach to create Master Record Rules using the AI Assitant.

Users can type in their business rules using natural language.  The AI Assistant will process these instructions and generate a rule.

You can also request an AI recommended rule for master record selection. The AI Assistant analyzes all fields in your object and generates a recommended master record rule tailored to your org, which you can review and adjust before saving. When your data makes it useful, the recommendation can be based on related-record counts and names the related lists it used.

Prompts such as "keep the account with the most opportunities" or "keep the record with the most related records" generate a rule that sorts by the matching count (# of Opportunities, # of all related records). Only counts that exist for the selected object are used. The Most Related Records quick start template (category General) does the same without a prompt: it keeps the duplicate with the most related records and breaks ties by the most recent Last Modified Date.

 

For manual operation, navigate to the Rule Designer section, drag the Sort group by, then sort by,  prioritize record if and Set master to objects into the rules work area.


  1. Each rule must start with the Sort group by object, which determines the initial sort criteria.  Users can select the field name and sort order (Ascending/Descending).  There must only be one of these blocks
  2. Additional sort criteria can be added using the then sort by block. Users must also select a field and sort criteria for this block. This block is optional, but multiple of these blocks may be added.
  3. Finally, a rule must be completed by adding the Set master to block.  Users must select first or last record for this block.


TIP: The Preview area will display a the results of the created rule using sample data.


Good to know: A flag next to the Rule Preview label will automatically display the validity of the current rule.



Let's take a closer look on each of available options: 


Functions


SORT GROUP BY [FIELD] [ORDER] - each rule must start with this block, it determines the initial sort order, you can choose a field that you want to use for sorting and the order (descending, ascending).


THEN SORT BY [FIELD] [ORDER] - the secondary sort order that will be apply to the group after the first one, you can use as many sort blocks as you need. For example:

BUT PRIORITIZE RECORD IF [FIELD] [CONDITION] - it allows to prioritize the record from the matched group by some specific condition regardless of the main sort order. For example, mainly you want to sort the matched group by Last Modified, Created dates but if there is a record with Match Confidence greater than 90- you want to set this record as a master record:


BUT PRIORITIZE RECORD IF -  it allows to prioritize record by logic condition using quite complicated scenarios and combining different functions together. For example, mainly you want to sort the matched group by Last Modified, Created dates but if there is a record with Title from the list - you want to set this record as a master record: 

SET MASTER TO [FIRST/LAST] RECORD - it can be used to determine which record (first or last one) from the sorted group will be chosen as a master record.


SORT GROUP BY VALUE [VALUE] [LOWEST/HIGHEST FIRST] - sorts the group by any calculated number instead of a field, for example the sum of two related-record counts. THEN SORT BY VALUE [VALUE] adds a secondary sort by value. The existing Sort group by and then sort by blocks are unchanged.


Records

Records blocks return the number of records related to a duplicate, so the master can be chosen by how much history it carries (for example "the Account with the most Opportunities survives"). Both blocks return a number and can be used in comparisons, arithmetic and prioritize conditions.

NUMBER OF RELATED [RELATED LIST] - the number of records in the selected related list (for example Opportunities). The dropdown lists the counts added to the rule. Deleted and archived records are not counted.

NUMBER OF ALL RELATED RECORDS - the total number of related records across all related lists of the object. Always available.


Counts also appear in the Sort group by, then sort by and prioritize record if field dropdowns as # of Opportunities, # of all related records and so on, so the simple case needs no extra blocks. In the field picker, counts are listed in a Related records group under each object (type Count); # of all related records is in the All group, pre-selected and locked like Match Confidence.


Good to know: A rule that uses a specific count such as # of Opportunities works only for that object (the object badge shows Account); a rule that uses only # of all related records works for every object. In the preview, counts receive sample values from 0 to 40; real counts are read live from Salesforce when the rule runs.


Math

The Math category (under Advanced, next to Records) contains the arithmetic (+, -, ×, ÷, ^) and round blocks, the same as in the Transform and Data Quality editors. Combine them with the Records blocks and Sort group by value, for example to sort by Opportunities + Cases, highest first.


Logic

Logic section contains logical functions that returns True/False as a result.

EQUALS/ NOT EQUALS/LESS THEN/... - this feature enables the comparison of two values by utilizing a group of permitted functions {equals/not equal to/ less than/ greater than/ less or equal/ greater or equal/ contains/ does not contain/ starts with/ ends with}.


In the example below, the rule guarantees that if there is a duplicate record that contains "Information" word in its title - it will be chosen as a surviving record:  


AND/OR - it allows you to logically combine set of conditions. Additional AND/OR blocks can be nested at bottom slot or within IF blocks to create complex logical expressions.


In the example below,  the rule will prioritize the record if it has False in Deceased field and Title has one of the values specified:



IS EMPTY - this allows for a comparison of the value to empty/null. 


In the example below,  the rule will give preference to the record if it contains a blank Title field value: 



NOT -  inverts boolean value connected to the right, i.e. returns true if provided value is false and false if true. 


In the example below,  the rule will give preference to the record if it Title is not blank: 


MATCHES REGEX - it returns true if a field value matches to the regular expression (RegEx).


In the example below, the rule guarantees that if there is a duplicate record with email address from datagroomr.com domain - it will be chosen as a surviving record:  


Values

Values section contains blocks with plain values of Text, True/False, Empty(Null), Number, Current DateTime. These blocks can be used in connection with other blocks. 



TEXT - a text value

BOOLEAN - a boolean (true/false) value

EMPTY - an empty/null value

NUMBER - a number value

NOW- a current datetime value


Fields

The section contains blocks to manipulate field values and field names. 




FIELD VALUE [FIELD] - returns specified field value from a record field.


FIELD NAME [FIELD] - returns field name of the specified field.