Get Unique Records (Excluding Duplicates) - Flow Designer

Vinay52
Tera Expert

Hello, 

I have a custom table and get the records created in one day and i would like to exclude the duplicates and get only unique records. 

Ex - Table 1

User IDNumberStatus
Mike1 
John2 
John3 
San4 
John2 

 

Here John has 2 entries where User ID and Number are matching. I would like to get 4 Unique records excluding 1 record of John and update that record as Duplicate. 

 

I tried to use "look up records" with the condition of created in one day and then "For Each" with Transform Function - Unique by Name or Number - Utilities transform functions to get the unique but not getting the result. 

 

Any other ideas? Thank you

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @Vinay52 ,

There is no OOB way to get unique records using Lookup records action. And, the utilities transform applies on array elements not on complex objects. One way is to implement a custom script to get the unique records or the flow designer itself, but the complexity will be O(n^n).

 

For example, I designed a simple flow for demonstration purpose, which finds the users and search for duplicates based on name and email fields.

AnveshKumarM_9-1680866414806.png

 

1. Get all users created in last 24 Hours and active.

AnveshKumarM_1-1680865853942.png

2. Iterate through each record.

AnveshKumarM_2-1680865943658.png

 

3. Find all the records with same name and email ID using lookup action

AnveshKumarM_5-1680866228455.png

 

 

4. If the records count is greater than 0 make other records in active.

AnveshKumarM_6-1680866255001.png

 

 

5. Update the records to in active excluding the first record using for each and update record.

AnveshKumarM_7-1680866304081.png

AnveshKumarM_8-1680866350075.png

 

 

Mark this answer Helpful 👍/  Accept solution ✔️if helped you resolve your issue.

 

Thanks,

Anvesh

Thanks,
Anvesh

View solution in original post

6 REPLIES 6

@Vinay52 

In which table you are working and What is the field you are using to mark the record duplicate and what is it's type.

 

I'll try to figure out the issue in my insurance.

Thanks,
Anvesh

Hey @AnveshKumar M 

Table is - sys_user 

Trying to check if "Name" and "Email Address" matches then update custom status field which is string. 

I also tried Active Flag as you shown in the screenshot and that also did't work. 

NameEmailStatus
san ksank@example.com 
san k sank@example.com 
san ksank@example.com 
milch mmilchm@example.com 

 

With the above records - it should update 2 records (san k) status field with Duplicate and other 2 records (san k and milch m) to be blank.