Help

Re: Unique values in a column

7863 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Graham_Charles
4 - Data Explorer
4 - Data Explorer

Hi there! I’m just curious how I enforce unique values in a column or a group of columns – that is, how to enforce a unique constraint. So that I don’t, for example, accidentally enter the same person (combination First Name + Last Name) twice.

15 Replies 15
Mics_Sky
6 - Interface Innovator
6 - Interface Innovator

You can add a new field, i’ll call it ID, and give it a formula record_ID(). You’ll find that even for 2 records with the same name+First name, internally, they are different. You can also add an auto numbered field in case you need a more visual and easy content on your layout.

Do you need to enforce unique First Name+Name ? Not always a good thing, not always possible. I remember the time were programmers wrote something like JohnOsborne1, JohnOsborne2, awful !

Hope it helps !

Graham_Charles
4 - Data Explorer
4 - Data Explorer

Ah, yes – name was a bad example. But there are lots of legitimate times to enforce a unique constraint. So… As I’m understanding, this isn’t possible with AirTable, which means, essentially, it’s not a database, but rather a fancy spreadsheet. More Google Forms than MySQL.

Still, an interesting product – it’ll be interesting to see if it develops into a functional DBMS.

Yes, i see!
The Primary Field, the first field in a table, should have the uniqueness you are asking for. I can’t see how to force it in " Customize field type".
Maybe you can apply a formula combining other fields or whatever magic calculation. I didn’t try yet.
Of course Airtable is not Mysql. I use it for what it is, a very good and easy tool for “online tables” for personal use or for a workgroup.

Would you mind posting this feature in the " FEATURE REQUESTS " section ?!

Yep - had the same problem. Not really a database if you can’t make the primary field (identifier) unique.

You can make the primary field unique. Airtable just doesn’t enforce it, is all. But you can enforce it if you want to.

Airtable does enforce a unique ID for each record, it just isn’t exposed to you as the user unless you dig it up with a formula field and this formula:

RECORD_ID()

image.png

You could use Airtable’s unique ID for your record as the Primary field if you want.

You could create an Autonumber field, and then pull the auto-number generated into your Primary field if you want.

You could use the De-Duping block to enforce uniqueness on pretty-printed Primary fields if you want.

There are plenty of options for doing your own enforcing of uniquness on the Primary field.

Thank you.

Is there a way to make a text field unique? For instance, if I want to create a short text field for Store Name, I don’t want a user to be able to enter duplicates of that Store name. The field should be unique and not allow a duplicate entry.

Is this possible?

Thanks for your help.

Amy

There’s no way to prevent the same store name from being entered twice. When it comes to any manual entry field, Airtable offers no mechanisms that restrict data entry.

If you’re working solely in Airtable, the best you can do is incorporate some (admittedly complex) table mashing to internally track each thing entered into a specific field, and pop a visible indicator into another field if a duplicate is found.

If you’re using an external form system like Jotform for entry, there may be ways to throw up a similar alert during the entry phase, and prevent the form from being sent until it’s corrected. (I’m still coming to grips with Jotform, so I can’t say for sure whether that functionality is possible.)

Thank you for your helpful reply, Justin. Much appreciated.

Amy

Moe
10 - Mercury
10 - Mercury

We’ve built this feature in our form to enforce unique values in a field.

Alexandre_42
4 - Data Explorer
4 - Data Explorer

What suited my case:
I created a column simple select with a value “NOK” with the color red
I created an automation:

  • trigger:
    • whatever you like
  • action:
    • find records (creates a list of records that passes a condition)
  • conditional action
    • if list_records > 1 → set simple select of curent record as NOK

And then every time i create a new record if it already exists, i see it with that with the flag NOK and i can decide to remove the new record or fuse the new and the old one

Thanks @Alexandre_42. I am trying to do the same. But htere issomething that I do’nt get: ¿What is the condition to cretae a list with the same value in a column? Thank’s

@Alexandre_42 I finnally get it done. Your advice were very usefull for me. Many thank’s

agbush
4 - Data Explorer
4 - Data Explorer

Adding a voice to get this added as a native feature in the product - i just want a way of setting  "this text column needs to have uniqe data in it"

cameron_tangata
5 - Automation Enthusiast
5 - Automation Enthusiast

Any updates on this? I don't think I need to say how important this is.

MarcoLaRosa
4 - Data Explorer
4 - Data Explorer

I have the same problem with my item master data. I don't want to use the same SKU twice and therefore it would help to set a column to "unique values" so you are not even able to add if it´s already used.