Locating Duplicate Records / Duplicate Values in Records

Hello everyone!

I have recently found a way to spot duplicate records or values within records. Since the training team has received this question before, I thought it would be a good idea to create a forum post about it. This way, it can help others in the future who might have the same question.

I’ve put together two brief guides. One explains the best practices for preventing duplicates, and the other outlines how to identify duplicates when you haven’t implemented these best practices.

Best Practice – Enforce Unique

If you want a property to keep only unique values, you can do this by creating a new property with the ‘New Data Type’ option and making sure to tick the ‘Enforce Unique’ setting.

This ensures that any value you put into that property will be checked to ensure it’s unique compared to all other records in the object. If a value is submitted into a record where the same value already exists, an error will be generated. It’s a useful way to keep your data accurate and avoid duplicates.

Identifying Duplicates Without Best Practices

In this scenario, the email address field in the user object isn’t set to be unique right from the start. By default, the platform doesn’t do this automatically. So, if you find yourself in this situation, I’ve included some extra steps below to help you switch from a non-unique property to a unique one.

  1. Begin by placing a ‘List’ widget on a page. In my example, make sure it’s orientated towards the user object.

  2. Next, in the ‘Count (Having value)’ aggregate form, add the ‘ID’ attribute to the list widget. You can do this by selecting the ‘ID’ attribute after choosing ‘Count (Having value)’ from the ‘Aggregate’ drop-down menu.

  3. Add a column that’s focused on the property or attribute where you want to identify duplications. In this example, it will be the email address property.

  4. (Optional) For added benefit, we can add the ‘ID’ attribute in ‘Concatenated List’ form to the list. This will provide us with a list of record ID’s which have the duplication.

  5. Finally, in this last step, we’ll set up the list widget to function as needed. In the list widget settings, we should orient the list widget around the property or attribute we want to focus on for identifying duplications. Within the widget settings, enable the ‘Use grouping’ setting and then select the ‘Add Field’ button. From this point, choose the focus, which, for this example, is the email address property.

  6. Publish the page and take a look at the list widget. Here’s my example:

    By selecting the ‘User Count’ column and arranging it in Descending order, I can easily identify three email addresses that have been used more than once, along with their respective record numbers.

Switching from a non-unique property to a unique

  1. Start by creating a new property with a different data type and select ‘Enforce Unique’.

  2. Next, create a Signal.

  3. Now, create a rule using the Signal from Step 2 as the Trigger. In the response tab, use the ‘Copy field value(s)’ action. Set the ‘From’ field as your old non-unique property and the ‘To’ field as your new unique property.Save the Rule.

  4. On a page, add an ‘Action Link’ with the action ‘Trigger Signal’. Choose the Signal from Step 2 in the ‘Trigger Signal’ dropdown and publish the page. But don’t click the link just yet.

  5. If this property is used for user accounts or logins, be sure to add the new unique property to your account management pages. Manually set the value for your own account, like email address, to avoid login issues.

  6. Replace all instances of the old non-unique property with the new unique one. Keep the old property; don’t delete it.

  7. Confirm that you’ve completed Step 5 to ensure you can still log in. Once you’re sure, go ahead and click the action link.

Hope you find this useful :slight_smile: , if you did or if you stumbled across this post as part of a search, like the post by pressing the :heart: button below :slight_smile:

Kurt - Trainer [Netcall Academy]