How to issue a message when writinh a value that is already in the table

I would like to know how do I make sure that my application does not record duplicate data in a table.

Example: I have a training list table and wanted my app to send an error message if the training has already been performed

I don’t want the user to be able to record the training twice in a document.

Hi @Alex_Santos,

what do you exactly want to check for being unique?

If ID2 must be unique, just make it the ID (then you dont need the raanadom string).

If a combination of values needs to be unique, you can also make ths combination the ID as long as the values are set at the same time.

Otherwise you can make a query filtering on your values and an aggregation with “Count” on ID column. Check this for beeing one (or before creating beeing 0)…

As you can see … the answer is as always: “depends on your usecase”

So. In my case I have a table that generates the IDs as the collaborators do the creation of a document. This table that I am mentioning is the training table, that is, each employee who performs a training in this document with a certain document, this information is saved in the document table. As I understand it, it’s just me removing the ID column and keeping the ID2 column which is the same as the main document creation table.

Yes you cant remove the ID column, since this is the only mandatory column and the primary key of the dataset, but you can remove ID2 and put your ID2 value into ID instead of the random string.

ID - Column is always the primary key and is always unique.
If you try to add a value twice to this column you will get an error.

You can also make a query on the column, which filters on the value you try to save and if it finds a result (Aggregation Count > 0) you can cancel and show a message.