How to enforce unique values in text field?
Is it possible to define a text field to contain unique values only (no duplicates)?
17 replies
-
Hi,
If I understand you right you want to ensure that you are not inserting duplicates during the input.
That can be done with a formula on the "Trigger on Update" in the options of the datafield:
let myInput := Table1.'Text_field';
if cnt((select Table1)['Text_field' = myInput]) > 1 then
alert("Duplicate, choose another value.");
'Text_field' := null
endBest regards, Jörg
-
+1
-
yes, that is exactly what I was looking for - thanks a lot!
-
Thank you, this was helpful.
-
uhm.... Table1.'Text_field' not work for me. I can't select the table in formula....
-
GooD!
-
Thanks a lot, Jorg, It Seems to be working for me, but it just erases the duplicated serial, and no alert appears. I'm my case, I need unique serial numbers
this is my code
let myInput := Serial;
if cnt((select Stock)[Serial = myInput]) > 1 then
alert("Already in Stock!");
Serial := null
endI'm new at NINOX, coming from Filemaker, which is just a checkbox on the field options menu.
Thanks a lot.
-
Thanks a lot, Alan!
I'm very new to NINOX, and I just discovered yesterday there are two versions of NINOX: Desktop app and web-based, which I guess is the NINOX Cloud.
I solved it with the following lines.
let myInput := Serial;
if cnt((select Stock)[Serial = myInput]) > 1 then
alert("Already in Stock!");
Serial := "Duplicat"
endI'm keeping the original alert, just in case I move to the desktop app.
If my input is a duplicated serial number, then I get the "Duplicated Serial" directly on the field
This way is very clean and visual for the user.
Now to fight on how to lookup data from other tables without manual input! :)))
Thanks a lot!
Content aside
- 7 mths agoLast active
- 17Replies
- 2969Views
-
5
Following