Tim Dietrich

Custom Software Developer

Home Services Portfolio Blog About Contact Newsletter

Airtable: Simulating A Case Function

If you've done programming or scripting with other development tools, then you might be familiar the "Case" function. The Case function evaluates a list of conditions and returns a result.

Airtable doesn't support a Case function yet. It's coming soon...

However, using embedded "If" statements, you can easily simulate a Case function. For example:

If ( {Total Budget} >= 1000000, "A", If ( {Total Budget} >= 500000, "B", "C" ) )

In that example, we're evaluating the value if a column named "Total Budget." (We've wrapped the column name in curly brackets to account for the space in the column name.) The outer If statement will return "A" if the value of Total Budget is greater than or equal to 1,000,000. Otherwise, it will move on to the second If statement. If the Total Budget is greater than or equal to 500,000, then "B" is returned. Otherwise, "C" is returned.

Note that while this example only uses two If functions, additional Ifs functions could also be used. For example:

If ( {Total Budget} >= 1000000, "A", If ( {Total Budget} >= 500000, "B", If ( {Total Budget} >= 250000, "C", "D" ) ) )