- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 12:03 AM
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 ID | Number | Status |
Mike | 1 | |
John | 2 | |
John | 3 | |
San | 4 | |
John | 2 |
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 04:22 AM
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.
1. Get all users created in last 24 Hours and active.
2. Iterate through each record.
3. Find all the records with same name and email ID using lookup action
4. If the records count is greater than 0 make other records in active.
5. Update the records to in active excluding the first record using for each and update record.
Mark this answer Helpful 👍/ Accept solution ✔️if helped you resolve your issue.
Thanks,
Anvesh
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 09:42 AM
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.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 09:59 AM
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.
Name | Status | |
san k | sank@example.com | |
san k | sank@example.com | |
san k | sank@example.com | |
milch m | milchm@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.