Skip to main content

Unique values in a column


Forum|alt.badge.img+2

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.

18 replies

  • Known Participant
  • 23 replies
  • April 29, 2016

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 !


Forum|alt.badge.img+2

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.


  • Known Participant
  • 23 replies
  • April 30, 2016
Graham_Charles wrote:

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 ?!


Forum|alt.badge.img+3
  • New Participant
  • 3 replies
  • July 24, 2019
Graham_Charles wrote:

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.


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


Forum|alt.badge.img+18
Amy_Turner wrote:

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()

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.


Forum|alt.badge.img+3
  • New Participant
  • 3 replies
  • July 25, 2019
Jeremy_Oglesby wrote:

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()

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


Justin_Barrett
Forum|alt.badge.img+20
Amy_Turner wrote:

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.)


Forum|alt.badge.img+3
  • New Participant
  • 3 replies
  • July 26, 2019
Justin_Barrett wrote:

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


Forum|alt.badge.img+15
  • Inspiring
  • 368 replies
  • August 14, 2020

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


Forum|alt.badge.img+2
  • New Participant
  • 1 reply
  • February 23, 2022

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


Forum|alt.badge.img+10
  • Participating Frequently
  • 19 replies
  • November 12, 2022
Alexandre_42 wrote:

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


Forum|alt.badge.img+10
  • Participating Frequently
  • 19 replies
  • November 12, 2022
Alvaro_Hernande wrote:

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


Forum|alt.badge.img+2
  • New Participant
  • 3 replies
  • January 26, 2024

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"


Forum|alt.badge.img+3

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


Forum|alt.badge.img+2
  • New Participant
  • 1 reply
  • February 23, 2024

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. 


Forum|alt.badge.img
  • New Participant
  • 1 reply
  • May 21, 2024
Alvaro_Hernande wrote:

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


Could you help me with getting the condition part setup to create a list? I have tried a few different ways, but either it always fills in the 'NOK' field or never does. No matter what I type in.


Forum|alt.badge.img+3
  • New Participant
  • 1 reply
  • October 15, 2024

I also would like to voice support for the wish that AirTable adds a new attribute for each field for which the user can select whether or not the value of that field should be unique. 


Forum|alt.badge.img+4
  • New Participant
  • 4 replies
  • February 5, 2025

Enabling a 'Ensure values are unique' to a field would be HUGE for the community.  Please do this Airtable!


Reply