Help

New function: SWITCH() (and a recap of new summer features)

cancel
Showing results for 
Search instead for 
Did you mean: 
Katherine_Duh
Airtable Alumni (Retired)

Hi everyone! I know we’re not always as consistent with posting in this forum category as we could be (to say the least), but I figured that this latest new formula was especially worth signal-boosting, given how many people who come to the forums are either formula experts or aspiring formula experts.

Using the new formula:

SWITCH(expression [, pattern, result]... [, default])

you can take an expression, a list of possible values for that expression, and for each one, a value that the expression should take in that case. It can also take a default value if the expression input doesn’t match any of the defined patterns. This is formula is particularly helpful if you often find yourself fumbling through complicated nested IF() statements, since this can replace IF() in situations where you’re comparing a value to a series of explicit values.

Consider the following example, in which you want to return different emoji flags depending on the value in a status field. With a nested IF() formula, it might look like this:

IF(Status="Ideation","💭",IF(Status="Awaiting Review","🤔",IF(Status="Design Phase","🎨",IF(Status="Awaiting Final Approval","💬",IF(Status="Done!","🚀",IF(Status="On Hold","💤",IF(Status="Canceled","💀","")))))))

You could instead construct this in a simpler way using SWITCH(), like so:

SWITCH(Status,"Ideation","💭","Awaiting Review","🤔","Design Phase","🎨","Awaiting Final Approval","💬","Done!","🚀","On Hold","💤","Canceled","💀","")

The results will be the same either way, but with SWITCH(), you won’t be grappling with nearly as many parentheses.
IF-vs-SWITCH

Unrelated to this new formula, we’ve also released a bunch of new features/updates in the last two months, both big and small, that are worth checking out. You can always head on over to our What’s New page, but here are the highlights:

Pro plan features:

  • Locked views: this one is kind of a big deal! I’ve posted about this in a couple of forum threads already, but if you missed it, users with creator permissions can now lock views to prevent all collaborators from altering a view’s configuration. Now you can stop other people from messing with your carefully filtered views, or the views you’ve created to power Zapier integrations! If you want to learn about even more uses for locked views, you can read through this blog post on view management in large teams for some inspiration.
  • We’ve updated record coloring for gallery and kanban cards. Now, the color flag takes up the entire length of the left side of the card.

Blocks

  • Org chart block now supports using attachments as cover fields, putting multiple secondary fields on cards, and record coloring.
  • Page designer block now supports sending layout elements forward/backward.
  • Contact import block now supports uploading a vCard to update existing records in a table. (Previously, you could only add new records.)
  • Map block pins will now cluster instead of stacking on top of one another, making it easier to see the density of pins in a location.

Other

  • New account and workspace settings pages: in addition to refreshing the appearance of the account page and of the workspace settings pages, we’ve made it a lot easier to get a high-level overview of all the workspaces you own. From your account page, you can click on any of the workspaces in the sidebar to modify your billing settings or see a list of all billable collaborators for that workspace.
  • You can now prefill forms with linked record fields (when you couldn’t before).
  • New keyboard shortcut! Use Ctrl/Cmd + Shift + D to open the grouped records menu while in grid view.
  • Icons for forms in the view menu are now pink instead of cyan (we were getting a lot of feedback that the cyan was too similar to the grid view’s blue).
7 Comments