Flow Action - Find Master Record by IDs

Last published at: 2023-03-27 07:57:27 UTC
Delete

DC Flow Actions are available in the Premium Edition.

The "DC - Find Master Record By IDs" flow action lets you determine what would be the master record out of a collection of record IDs. The master record is resolved based on the DC merge rules, and the master record ID is returned. 

Note that the records are not actually merged with this flow action. The flow action only determines what would be the master record if these records were to be merged. Use this flow action for example to mark the master record as Master, without having to delete the other records.

The records in the collection might have been found earlier as duplicates of each other, but this is not mandatory. Just make sure that all records in the collection are of the same object type.

1. Make sure Merge Rules are set up

Duplicate Check uses the merge rules as set for the object in question to decide upon the master record in a flow action. 

  1. Go to DC Setup.
  2. Open the Object you want to apply a Flow to. 
  3. At the Merge Rules tab, make sure at least a General Rule is set up, and optionally other merge rules as well.
    Learn more about merge rules.

2. Create a collection of record IDs

Create a list of record IDs to resolve the master record from. Make sure all records are of the same object type.
One way to create such a list is by collecting the record IDs in a Collection Variable:

  1. In the flow, add an Assignment element.
  2. In the Assignment, under Variable, add a new Resource of type Variable, with data type Text, and Allow Multiple Values enabled. Or use an already existing collection variable.
  3. Enter the list values, i.e. the record IDs, manually or from a variable. Enter each value on a new line with Add Assignment.
    Enter only record IDs as values, all of the same object type.
  4. Click Done to add the variable to the flow.

3. Add the Find Master flow action to the flow

  1. Add a new Action element to the flow.
  2. In the New Action dialog, search for 'DC - Find Master Record By IDs' and select it.
  3. At Label, define a name for your action. If the API name is not set automatically, enter an API name as well.
  4.  At Set Input Values, click in the RecordIDs  field.  
  5. Select the collection of record IDs as input. If you used a variable assignment in step 2, select that collection variable. 
  6. Click Done and save the flow.

4. Connect your action to the Start trigger

Make sure the flow action, and any preceding flow actions or assignments, are connected to the Start trigger. 

5. Run the flow

Run the flow by clicking "Run".

'Find Master Record By IDs' action results

After executing the flow, the 'Find Master Record By IDs' flow action returns the following parameter that can be used in other flow actions:

Parameter Description
masterRecordId The record ID of the duplicate record that would be the master record according to the merge rules.