Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Re: Primary Key and Pick List

2149 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Charles_Osterta
6 - Interface Innovator
6 - Interface Innovator

Can you create a picklist for entry into a primary key field? This would allow a standard and defined list instead of letting anything go into the field.

Thanks in advance. charley

5 Replies 5

Hi @Charles_Ostertag - although Airtable doesn’t enforce uniqueness on the primary field, I find it is generally good practice to make this field unique if you can. As you’ve found there are certain field types which aren’t permitted in the primary field and although I don’t know this for certain, I’m guessing that it was Airtable’s intention to push us to make the primary field unique if we can. Using a single select/pick list would go against that approach - otherwise you might end up with may rows with the same primary field value.

It would be interesting to know a bit more about the design of the table or base to see if there is a better approach to take.

Charles_Osterta
6 - Interface Innovator
6 - Interface Innovator

That is what I want to do, enforce uniqueness by a checklist. I understand primary key and the concepts and do not want users entering duplicate keys with slight variations to the title, if you follow. A pick list would allow me to do that. Using a single select pick list forces uniqueness.

I don’t understand the logic there. Single select fields enforce uniformity, not uniqueness, because they only allow options in that list to be chosen. If a single select contains a list of fruits, and 10 people choose “Apple,” there’s definitely nothing unique about that.

Can you provide a more detailed example of how you see this working to create unique entries?

In database terminology a primary key is unique and allows no duplicates to be entered once set up. It may be different in Airtable and that is why I asked the original question. If I sort on primary key or any other actions from the primary key, I want the categories to be consistent. Using your example of fruits. If I wanted a category called fruits I would not want people putting in apple, or peach, that would be a sub category below fruits. It helps for searching on a category where you might not know the subcategory which could be any item.

I am looking at the potential to put in a formula in the primary key field that will limit the category selections and ensure no duplicates, sort of a behind the scenes data integrity for my table.

I’ll let you know if it works.
Thanks for responding, charley

In Airtable, uniqueness of the primary key is maintained internally via the record’s ID. However, Airtable does not enforce uniqueness of the data entered into the primary field. Someone could enter the same thing into the primary field in several records, but Airtable still sees them as unique because of their internally-generated record ID, which you can see via the RECORD_ID() function in a formula field.

Airtable formulas only operate on data collected from other fields. A field can’t contain a formula and also allow for manual entry (much to the chagrin of some users here :winking_face: )

Still, you haven’t offered much detail on what exactly you’re trying to do in terms of duplicate prevention. Are you trying to prevent duplicate dates from being chosen? Prevent duplicate items from being picked in a predefined list? I realize that some projects have NDAs, and you may not be able to go too deep if that’s the case, but the more info you can share, the more we can help you find a solution that will work.