Flow Action - Get Duplicate IDs from Flow Output

Last published at: July 7th, 2023
Delete

DC Flow Actions are available in the Premium Edition.

Gather duplicate IDs that you found with other flow actions in a collection, by using the 'DC - Get Duplicates IDs from DC Flow Output' flow action afterwards. This flow action will return a list of only the duplicate record IDs.

The results of the DC duplicate search flow actions, Find Duplicates By Field Values‍ and Find Duplicates By ID‍, contain a lot of information about the found duplicates, such as the scenario that was used, the matching percentage, etc. If you are only interested in the IDs of the found duplicate records, and need them collected in list format, use this flow action after a search flow action. Then use the output, the collection of duplicate record IDs, in other flow actions.

1. Add a Find Duplicates flow action to the flow

The 'Get Duplicates IDs from Flow Output' flow action uses the output of earlier search actions as input. These search actions will have found a number of duplicate records, that this flow action will then gather in a collection.

You can use the results of the 'DC - Find Duplicate by Field Values' and 'DC - Find Duplicate by Record ID' flow actions as input for the 'DC - Get Duplicates IDs from Flow Output' flow action. Add one of these to your flow first.

See Find Duplicate by Field Values or Find Duplicate by Record ID for information on how to add these flow actions to your flow.

2. Add the Get Duplicate IDs flow action to the flow

  1. In the flow builder, open the flow where you also added a DC duplicate search flow action. Below that flow action, add a new Action element. 
  2. In the New Action window, search for the 'DC - Get Duplicates IDs from DC Flow Output' action and add 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 Duplicate Result field. 
    1. Click on the output from the preceding DC search action: Outputs from <name of the previous flow action>.
    2. Select the Duplicate Result parameter.
  5. At Object Prefix to retrieve the IDs for
    1. Switch toggle to Include.
    2. Enter the prefix of the Object you want to collect record IDs of. Make sure to only enter one object prefix, and with the correct capitalization, as the object prefix is case sensitive.

      The Object Prefix consists of the first three characters of the record ID of a record of a certain object. For example, if you have a Lead record with record ID '00Q7Q000001BRA5UAO', you know that the Lead Object prefix is '00Q'. An exception to this rule is the Person Account, which has '001P' as a prefix.
      A list of common object prefixes can be found at https://www.salesforceben.com/salesforce-object-key-prefix-list/ .
  6. The 'Threshold' option is optional. Use it if you want to filter the records on a higher threshold than was used in the scenario that found the duplicates. This can be useful if the duplicate search returned a large number of duplicates, and you want to collect only those records that have the highest matching percentage.
  7. Click Done and save the flow.

4. Connect your action to the Start trigger

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

5. Run the flow

Run the flow by clicking "Run".

'Get Duplicates IDs from DC Flow Output' action results

After executing the flow, the 'Get Duplicates IDs from DC Flow Output' flow action returns the following parameters that can then be used in other flow actions:

Parameter Description
SourceId
The record ID that you started the initial duplicate search for, if you searched based on ID. If you searched based on field values, the result will be 'null'.
duplicateRecordIds
A list containing the IDs of the duplicate records that were found in the initial search.