Using the makeUnique() and isUnique() functions

makeUnique(table, v, field)

Checks whether the value 'v' occurs in the 'field' in the specified 'table' and if so, it creates its copy by adding the (n) suffix for text strings or adding 1 for numbers (till the unique value is found).

The 'v' can be any text, number or a text field name. The type v and the 'field' type must be the same.

=makeUnique("producs", "tofu", "productnames") returns tofu(1)
=makeUnique("producs", "tofu(1)", "productnames") returns tofu(2)
=makeUnique("producs", 10, "productID") returns 78

isUnique(v)

Checks whether the value 'v' (a text string or a number) already occurs in current field and if so, it returns 1. Otherwise it returns 0.

NOTE: The makeUnique() and isUnique() functions are two special functions that have the following restrictions:
If the 'table' is the same table where the function is used, makeUnique() can be executed only as a single action field conversion or validation formula and is inactive for any block operations or recalculation operations.
The isUnique() function is always used in-place, in the same field it refers to and it can be executed only as a single action field conversion or validation formula.