Data validation

#14

If I have fields in a table with specific types why doesn’t the form validate those types before submitting the data?

There seems little point in specifying a field type of email if someone can enter whatever they like into the form.

I realize that client-side form validation is non-trivial but there at least some native browser validations that could be implemented fairly easily.

2 Likes
#15

this is such a huge deficiency. no email or phone number field validation is probably the single biggest issue for us and why we can’t rely on airtable as a serious data management platform. its crippling for anyone that’s actually using the data to reach out to ppl via email or phone.

#16

I agree that some form of data validation is really necessary, especially for the email/phone number fields. Another use case I have for it is to ensure that people accurately put in the dates/times (eg, when filling in a timesheet, that they cannot say they ‘finished’ their shift before they started it).

1 Like
#18

@Adam_Reece I read your feature request and in my opinion it doesn’t fall into data validation (even though validation is much needed) but more as “cascading drop-down options” aka dependent drop-downs which should be also a nice feature.

1 Like
Compare two fields and pull out matching content
#19

I’m a little disappointed this hasn’t been addressed in any way since it was raised in 2015. Data validation isn’t really a “nice to have” in a database but a necessity. I understand there are lots of feature requests but this one seems critical. I too need it for traditional data validation but would love to see a cascading or nested drop-down function as we use data validation Excel and Sheets to build those. Can someone from AirTable respond here and let us know if this is even on your roadmap and if so where?

6 Likes
#20

Another +1 for this. Absolutely necessary!

#21

@Gustavo_Lopez, dependencies are totally a type of data validation. Only certain values are valid, but that list of valid values changes based on another field. It’s just a more advanced form of dynamic validation.

I’m +1 for needing these dependencies though. I just tried to make by first “base” and failed because my use cases all require one field’s allowed values being conditional based on another field. You’ll never be a competitor to Excel or Filemaker without validation. “Single select” just doesn’t cut it.

1 Like
#22

+1 for data validation!

#23

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

2 Likes
#24

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

#25

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

3 Likes
#26

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

2 Likes
#28

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.

#29

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.

2 Likes
#30

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

1 Like
#31

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

#32

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)

1 Like
Helpful Pre-Made Data Tables, Formulas, and Routines
#33

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!

2 Likes
#34

I have some data sets you can grab as well…

WorldDB

==> https://resonova.com/research/worlddb

This database contains every country name, ISO alpha2 code, ISO alpha3 code, national flag, currency name, currency ticker, national language, time zone, international dialing code, national capital, GPS grid location, and alternative and native language spelling of every country in the world.

It also includes every US state, state flag, state seal, state map, image of the states largest urban areas, image of every state’s rural area, capital city of every state, and a list of the largest largest cities in the US. … among other things.


DataDB

==> https://resonova.com/research/datadb

Basically a smaller version of Crunchbase

1 Like
#35

+1 for the cascading/dependency type of data validation, particularly - I was looking into switching from Excel, but being able to limit selections to certain subcategories based on the category in another field is too important for my data :frowning: