Formula help please

Is there a complete formula reference somewhere – with details about syntax for each formula (and ideally examples)? Looks like the manual has examples for some formulas but not all.

For example I’m trying to see if I can take a string like “125 William Porter” and parse just the numeric value. I can’t see a way to do it.

William

As far as I know, the doc that’s currently available at docs.tadabase.io is all there is.

Thanks, Tim. Do you have any idea how to do what I was asking – how to parse out a string like “125 William Porter” so that the result is just the numeric part (“125”)?

Is the field you’re looking to parse always that format of a 3 digit number, space, name?

Is the field you’re looking to parse always that format of a 3 digit number, space, name?

Well, that was just an example. But let me play along and answer your question no. What is a constant is there’s always a number, then a space, then some sort of text string. But the number part might be “8” or “80” or “160” or “1600”.

In FileMaker I could do this about ten different ways. Here’s one:

GetasNumber ( LeftWords ( "125 William Porter" ; 1 ) )

Little harder to do in Airtable because there’s no LeftWords() function, but in Airtable’s otherwise pretty bad calc feature you can at least get the position of the first space in the string, and then use that value to get all the characters on the left prior to the location of that space.

I could do it with regex too, but cranking up JavaScript and regex seems like overkill for something that ought to be fairly easy. And in any case, I’m not sure how to plug a little javascript into a table rule. :frowning:

Use SUBSTRING_INDEX()

https://www.w3schools.com/sql/func_mysql_substring_index.asp

MySQL formatting doesn’t quite translate. You might have use CHAR32 for the space but that function should get you there with enough bashing :hammer: