Help

Storage examples in Zaps

reference
Last updated:

You can use Storage by Zapier to preserve a small amount of data from one task for use later. This article includes examples of how to use Storage by Zapier for some common tasks.

Note

Storage keys can be no longer than 32 characters, and Storage values can be no larger than 25000 bytes. If you need to be able to store more than this, it's best to use an external SQL app.


Example Use - Counting Triggers

It’s often beneficial to report on the number times a Zap ran during a given day or week. One can use Storage Increment Value to count the times a Zap ran and a Schedule trigger to send a daily report. This would require 2 Zaps to do:

Zap 1: Increment

You can attach a storage action to increment a value to any Zap that you wish to track:

How to set up Increment Value Trigger

Zap 2: Report

The Zap above will increment the value, now we need a step to pull this data out and to send along as a notification. You would need to set up a trigger to fire every day, the Schedule by Zapier app is perfect for this. Then you need to pull the value from Storage:

How to set up the Get Value Action

Next, you will wish to delete the value to reset this counter, so you can start a 0 the next day:

How to set the Remove Value Action

Finally, you can send the value that you pulled during the Pull Value step to whatever action that we support.


Example Use - Coupons

You can use Storage to send and keep track of the coupons that you send to customers. This would require 2 Zaps to do:

Zap 1: Add Coupon Codes to the Storage App

In this example, we are populating the Storage with coupon codes from a Google Sheet trigger that fires whenever a new row is added to the sheet:

How to add coupons to your storage

Zap 2: Pull Coupon Codes from Storage and Send Them to Customers

Now that we have our Storage loaded up with coupon codes to use, you can invoke storage as part of a second Zap that you use to deliver these codes one at a time. In this example, we are triggering off of a MailChimp New Subscriber, pulling the coupon from Storage, and then sending it to the customer in an email:

How to send your retrieve a coupon from your storage


Example Use - Child Values

Storage by Zapier supports child values. Child values are nested values of data. This is useful if you want to be able to retrieve multiple related values at a time. Say, for instance, you’re storing information about “User_123”, including their name and email address. You could store this in a child value to be able to easily retrieve both the name and email address in one go.

To Set a Child Value, you would use the action of the same name in the Storage app:

How to set a Child Value

You can then either pull all the Child Values for a key using the Get Value search action:

![How to get a Value(https://zappy.zapier.com/2F0B3B75-FBBD-471D-8309-CEE5D0CB4BD4.png)

Or you can pull a single value using the Get Child Values search action. In this case, we are pulling the email address for this value:

How to get a Child Value


Example Use - Round Robin

Storage: Setting and Retrieving Values

Round Robin is a term used when you want to evenly distribute items to everyone in the group. This means that everyone will get a single "thing" before anyone gets a second "thing". This helps to evenly distribute actions over a group.

There are multiple ways to do this with Zapier. The easiest and most reliable method uses a combination of Storage by Zapier along with the Formatter by Zapier app.

This method relies on using a spreadsheet-like formula function in our Formatter tool: the Modulo function.

The first step would be to use the Increment Value action of Storage to set up a counter that we can increment every time this Zap runs:

How to set up an Increment Value

Next up, we would use the counter to perform the "modulo" of the number of items in the list. The number after the comma is however many items you want to round robin.

Using the Spreadsheet Formula, we can get which item to select. So, for a 4-item list, we would use this formula in the Formatter step:

How to use the Modulo formula in Formatter

Then, we use the modulo value for selecting which item in the list to select using the Formatter's "Pick from List" action. When the first number is 1, it outputs 1. When it's the same as the second number, it outputs 0.

How to pick an item from a list using Formatter

In Pick From List, the number 0 means the first option in the list. Because the modulo outputs 0, this works great!

Finally, we would then use the value that we picked from the last action:

How to send on your value

Example Use - Round Robin with Paths

Note

Paths are available for accounts on the Professional, Professional Plus, and Teams plans. If you’re on a Free or Starter plan, you can try Paths for free for 7 days. Just add a Paths step to a Zap and you can start your free trial from the editor.

In the event that you want to take different actions entirely (or have an app like Google Sheets where custom values can't easily be used) you can use Paths. For the above example, you could set up one path per possible Formatter output, then add the action(s) you need within those Paths.

If we have 4 Paths, you could use Formatter's Pick from List function to output one of four paths:

lHow to create a Pick From List with a dynamic Operation

Then set up one path for each of those possible outputs:

How to set up 4 Paths for each different outcome


Example Use - Round-Robin with two Paths

Here's an approach you can take if you're trying to do something like divvy up leads between 2 agents, offices, etc. Since you've only got 2 possible paths, we can use the Increment Value option in the Storage app followed by a Spreadsheet-Style Formula in the Formatter app to determine whether the value is even. If it is, output "Path A" and if it's not then output "Path B".

Storage — Increment Value

How to set up an Increment Value

Formatter — Spreadsheet-Style Formula

How to set up a formula in Formatter

Which Path?

Much like the example above, you would add rules to your paths to only continue if the output of that Formatter step matches your condition. In this case, you would only need 2 paths:

How to create two Paths with two different outcomes


Was this doc helpful?

Need More Help?

Zapier Support

Contact our world class support team and we’ll be happy to help you get up and running!
Contact Us

Hire an Expert

We have a directory of professionals across the globe who are ready to help.
Find a Zapier Expert