Help

This Product Ideas board is currently undergoing updates, but please continue to submit your ideas.

Data validation

cancel
Showing results for 
Search instead for 
Did you mean: 
Adam_Reece
5 - Automation Enthusiast
5 - Automation Enthusiast

I’ve just started using Airtable, and straightaway I’m wondering if it’s possible to replicate the data validation function available in Excel.

Specifically, what I’d like to do is select from a Single Select list (the field would be called Category), and in the next column/field have a Subcategory, which would give me a Single Select list with a unique list based on the selection I made in the Category field.

For example, if my Category selection was Utilities, my Subcategory selection list would include Phone, Electricity and Gas. Alternatively, if my Category selection was Travel, my Subcategory selection list would include Fuel, Public transport and Flights.

Thanks.

45 Comments
Bryan_Wall
4 - Data Explorer
4 - Data Explorer

I am evaluating Airtable for a project at my company and just discovered that it has no field validation on forms (or elsewhere). Without field validation, any form or database software is unusable if the quality if the data being input is important (when is it not important?).

Leon_Lukashevsk
4 - Data Explorer
4 - Data Explorer

+100 for data validation (please, please, please)

Optimi
5 - Automation Enthusiast
5 - Automation Enthusiast

I was completely bamboozled when i discovered that airtable does not validate form data! especially the primitives like email and url!

it even makes it sound like it does when you click “customise field type”

Absolutely ridiculous! I could write these in a few minutes using redux forms.

In this example it is using a very standard regex for emails:

const email = value =>
  value && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(value) ?
  'Invalid email address' : undefined

If you don’t understand js es2015 dont worry - this is basically saying:

variable email = the result of a function that takes "value" as input 
tests it is not 'null' && then tests that it passes the regex (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i). 
if it fails the function returns 'Invalid email address' 
if it passes it returns undefined 
(which makes sence when we are talking about validation errors
ie it passing means that there are no/undefined number of validation errors)

Now if I can write that into a comment in a couple of minutes and explain it in english for any airtable user to understand there is absolutely no reason why the product owners at Airtable cant prioritise this as a quick feature in the next sprint #strongsuggestion

Christine_Groff
4 - Data Explorer
4 - Data Explorer

Is there any way to accomplish field validation in Airtable?! This seems like a basic feature for a database.

William_Wickey
4 - Data Explorer
4 - Data Explorer

How do I set up data validation on airtable fields? (Has this issue been addressed yet?)

Also, a more basic version of this question:

Why are email address not being validated in the form view, if you specifically select the “email” field. How do I validate email addresses?

Thanks.

Martin_Kopischk
7 - App Architect
7 - App Architect

That standard regex is neither standard, nor will it work very well, as it accepts lots of invalid addresses while rejectings valid domains (TLDs have not been limited to 4 letters for what feels like ages, for one; even before vanity TLDs, the limit was 6). Before anybody starts copying this for, I dont know, whatever, please do read How to Find or Validate an Email Address.

Don’t get me wrong; I would love to see data validation in Airtable, but it is a highly complex topic and getting it right even for seemingly simple use cases is hard (see date parsing libraries et al); let’s cut Airtable some slack here.

Martin_Kopischk
7 - App Architect
7 - App Architect

… and to expand on the other issue at stake here, i.e. user defined validation of data, while a feature I’d dearly love, I suspect the conumdrum ist that Airtable can either

  1. allow validation through its formula language only, which, barring a serious expansion / overhaul of the formula system, would probably be considered too primitive and coarse grained for many purposes (there isn’t even a regular expression match available, never mind real array searches), or

  2. set up a whole language runtime on top of the current Airtable stack to allow for fully programmable validations (e.g. in JavaScript), which opens a can of worms when it comes to security and performance.

Joel_R_Putnam
6 - Interface Innovator
6 - Interface Innovator

Realize that this is a hard feature to implement (for all reasons summarized above). Would still love to see it if possible. After all, a lot of what Airtable does already was hard, and that’s part of why we love it - plenty of inadequate competition handled the easy challenges well.

+1 to this request

willinspire
5 - Automation Enthusiast
5 - Automation Enthusiast

Here are some functions that I wrote for parsing URLs. Hopefully they are of use to those of you who need to perform some validation and parsing.


Remove Punctuation

The following characters are removed with this formula:

*Single quotes
*Double quotes
*Hyphens
*Periods
*Comas
*Underscores
*Slashes
*Ampersands

Please note that this formula does NOT remove spaces.

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(<target_field>), "'", ""), ".", ""), "&", "and"), "-", " "), "/ ", ""), '"', ''), ",", ""), "\\", ""), '”', ''), '“', ''), "_", " ")

Normalize Concatenated Human Names

Normalize human names and titles from concatenated first and last names

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(UPPER(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(CONCATENATE(SUBSTITUTE(name_first, "'", ""), "_", SUBSTITUTE(name_last, "'", "")), ".", ""), "&", "and"), "-", ""), "/ ", ""), " ", "_")), '"', ''), "\\", ""), ",", ""), '”', ''), '“', '')

Encode Letters as Numbers

IF(LEFT(UPPER(title), 1) = "A", "01", IF(LEFT(UPPER(title), 1) = "B", "02", IF(LEFT(UPPER(title), 1) = "C", "03", IF(LEFT(UPPER(title), 1) = "D", "04", IF(LEFT(UPPER(title), 1) = "E", "05", IF(LEFT(UPPER(title), 1) = "F", "06", IF(LEFT(UPPER(title), 1) = "G", "07", IF(LEFT(UPPER(title), 1) = "H", "08", IF(LEFT(UPPER(title), 1) = "I", "09", IF(LEFT(UPPER(title), 1) = "J", "10", IF(LEFT(UPPER(title), 1) = "K", "11", IF(LEFT(UPPER(title), 1) = "L", "12", IF(LEFT(UPPER(title), 1) = "M", "13", IF(LEFT(UPPER(title), 1) = "N", "14", IF(LEFT(UPPER(title), 1) = "O", "15", IF(LEFT(UPPER(title), 1) = "P", "16", IF(LEFT(UPPER(title), 1) = "Q", "17", IF(LEFT(UPPER(title), 1) = "R", "18", IF(LEFT(UPPER(title), 1) = "S", "19", IF(LEFT(UPPER(title), 1) = "T", "20", IF(LEFT(UPPER(title), 1) = "U", "21", IF(LEFT(UPPER(title), 1) = "V", "22", IF(LEFT(UPPER(title), 1) = "W", "23", IF(LEFT(UPPER(title), 1) = "X", "24", IF(LEFT(UPPER(title), 1) = "Y", "25", IF(LEFT(UPPER(title), 1) = "Z", "26", "27"))))))))))))))))))))))))))

General URL Cleaning

*Remove the protocols http:// and https://
*Remove “www” sub domains
*Remove all sup pages and subsequent query strings

IF(FIND("/", IF(LEFT(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""), 4)="www.", SUBSTITUTE(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""),"www.", ""),IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), "")))=0, IF(LEFT(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""), 4)="www.", SUBSTITUTE(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""),"www.", ""),IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), "")), LEFT(IF(LEFT(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""), 4)="www.", SUBSTITUTE(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""),"www.", ""),IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), "")), FIND("/", IF(LEFT(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""), 4)="www.", SUBSTITUTE(IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), ""),"www.", ""),IF(LEFT(url, 4)="http", IF(LEFT(url, 5)="https", SUBSTITUTE(url, "https://", "", 1), SUBSTITUTE(url, "http://", "", 1)), "")))-1))

URL Cleaning and Subsequent TLD Extraction

Source code: pastebin[dot]com/raw/c9WmR6vJ
(the actual code is too long to include here)

W_Vann_Hall
13 - Mars
13 - Mars

These are great!

While not, strictly speaking, pre-made data tables, I’ve added a link to your reply to @Jeremy_Oglesby’s wikified post collecting handy data and routines.

Thanks for posting them!