Dupe function with parameters

EDIT: suggestion of extra function parameters and better description

I have been looking into identifying duplicate records and ways to get rid of them: it can be done but it requires four helper columns.

Can we get a function with the parameters to do this a bit easer.

It might perhaps look like this:
Dupe(table, field(s), newest/all/oldest,false/true/merge)

Where ‘table is the table to check (if this is used in a button), field(s)’ is one or more fields, all must match in other record(s) to be identified as a duplicate record
Newest/all/oldest indicates that of all dupes only the newest or the oldest record(s) get a checkmark (ready for being checked or deletion) or all records with a dupe are marked
true means the record will be deleted, false means it only gets marked (if the function is connected to a row with checkboxes) and merge meaning that the duplicate records will be merged (where identical fields keep their original value and from fields with different information, the latest/newest value will be kept - or, with another parameter switch, both values are copied in the remaining record). This last option should be inactive if ‘all’ is selected in the previous parameter.

With the above, you can identify dupes and/or clean up your table. Since the function is always active (as a column function), if there are three dupes and true is entered, the newest/or oldest records will be deleted until only one unique record is leftover.

As far as newest of oldest: this can be detected by row id or (in my opinion preferred) by a date/ time code field when specified int the same formula (row name instead of true. If the last parameter is blank nothing is deleted.

Perhaps this feels a bit overdone, but this will allow for deleting duplicate records that can exist due to on- and offline devices being used on the same doc (and it can also address a lot of other situations, like table updates though forms).

Depending on the doc, it can be very important to specify if the older or the newer record gets deleted (in many situations the older will be deleted, but in my app the newer record must be deleted).

The function should be available for buttons (to be pushed manually or by an automation) or checkboxes on the the grid (to be turned on/off for permanent activity) or as a function for a checkbox column.

@codans: I will be happy to show you in a live support session what my table looks like and why this would help out

1 Like

I updated the above suggestion quite extensively