Hey everybody! Nick here, from the Community team. Today’s post is a bit of a primer for the first part of an upcoming Formatter-related article series. We’ll first be tackling the mysterious spreadsheet-style formulas in Formatter by Zapier.
In this article, I’m going to show you how you can use that feature, along with Sub-Zaps, to create reusable steps.
If you’re anything like me, you probably find yourself using the same type of Formatter steps in multiple Zaps. Since we don’t have a way to copy and paste steps across Zaps (I wish we did), one way to solve the problem would be to duplicate a single Zap over and over, swapping out the apps if necessary. But there’s another way you can do it.
Using Sub-Zaps by Zapier you can build a Zap (or Zaps) that will do all of the formatting work for you, and maybe put those all into a single folder to make them easy to find. Think of these as Zap parts that you can plug & play into parent Zaps.
An Example Using Spreadsheet-Style Formulas
In this imaginary example, we’ve got summer classes and have 3 different sessions. There are 4 instructors, but more will be added during the summer. Each session has a different pay structure but in all cases, anything over $99 is considered premium. The kicker: there are 5 locations and each one has a different registration form.
Our Desired Outcome
We want to create a document in a particular folder, depending who the instructor is and which location. We also want to notify the instructor via Slack when someone has chosen the premium package, so they can reach out personally to welcome them.
What We COULD Do
We could build everything into a single Zap, then copy the Zap and change the steps where necessary. The trigger will be changing, but the rest of the steps will be more or less the same.
BUT: If something in those later steps changes, we have to go through each Zap and make the changes, with each one being turned off temporarily while we make changes. Like, maybe an instructor can’t teach at a particular location for a session. Or what’s considered “premium” changes.
A Better WAY
The part of the Zap that checks whether the person chose a premium package and which instructor/location was chosen, will be put into a Sub-Zap.
First, Let’s Build the Sub-Zap
In this case our Sub-Zap is going to do 3 things:
- Use a spreadsheet-style formula to check whether the amount paid is over $99. If so, output the word “premium”. Otherwise, output the word “standard”.
- Use a lookup table to check the instructor + location in order to output a folder ID that will be used in Google Drive.
- Send the results back to the parent Zap.
Trigger: Start a Sub-Zap
Action: Formatter — Spreadsheet-Style Formula
Rather than check to see if a plan is one of several, we can say that anything over $99 is considered “premium”. If the amount changes, we can modify this one Sub-Zap instead of multiple Zaps.
Action: Formatter — Lookup Table
Here we’ll use the combo of the instructor and the location to output an ID that can be used in a Google Drive step. When we see the value on the left, output the corresponding value on the right. If nothing matches, we’ve added a fallback value.
Action: Return from a Sub-Zap
Now we send the relevant data back to the parent Zap.
And Now, A Zap to Plug It Into
This will be just one of the Zaps, but you can imagine that others would be the same, except for the trigger step would change.
Trigger: A Form
This could be any form app. In my example, I’m faking it with a code step. Here’s the data we care about:
Action: Call a Sub-Zap
Now we map those fields into the appropriate places, then send it to the Sub-Zap.
We send it over, run those steps and then get back what we need to move on:
Action: Google Drive — Create File
We can use the folder ID from our Sub-Zap step:
Filter: Only continue if Premium
We’ll check to see if the person has a premium package. In this case, they do.
Slack: Send Direct Message
So we’ll send the direct message to the instructor.
Pros of Using a Sub-Zap (Especially with Formulas)
- You can do the work once and then re-use it across multiple Zaps.
- If something changes in the Sub-Zap, you only have to change it in that one place.
- You could share the Sub-Zap with your team members so they don’t have to figure things out, like spreadsheet-style formulas.
- You can created a Shared Zap out of that Sub-Zap if you’d like to make it easy for anyone (whether on your team or not) to make use of it.
Cons of Using a Sub-Zap
- They can be a little tricky to set up, since you have to connect two Zaps together.
- You can’t get the whole picture when just editing the parent Zap.
- You have multiple Task History pages to check if you have to troubleshoot.
As you can see, it can be convenient to include some steps in a Sub-Zap so that you can re-use that small part in multiple workflows, rather than have to re-build it repeatedly
Stay tuned for our Formatter series, which starts on Tuesday, July 6th. We’ll be diving more into spreadsheet-style formulas and hopefully we can de-mystify them.