How do I add a non-primary-key field that has unique values

In Base, I want to add a numerical field to a table, and ensure that no duplicate value is entered into this field. I tried creating a new index for that field, but an existing form is throwing an error.

Your requirement is not clear. I assume you already have a Primary Key which is auto-increment integer type. Do you need to have an additional key field where you fill in or generate values not linked or dependent on auto-incremented series? And of course how do you use this field! It should be possible to generate a date-time dependent series as key field.