Background
DataStore is a feature that lets your Applets define, store, update, and use variables to control how an Applet runs.
With DataStore, you can save data in filter code and use it later, either in the same Applet or in a different Applet.
You can store multiple values using different keys, making it possible to build more advanced logic such as:
- Tracking whether you're home or away
- Limiting how often an Action runs
- Storing timestamps or counters
- Coordinating behavior across multiple Applets
How to use DataStore
DataStore can be used in both Filter code and as Ingredients in Action and Query fields. You store variables using keys, and each key holds a single value.
In the Filter code editor, you’ll see a placeholder:
DataStore.myKey
You can replace myKey with any name to define your own variable.
For example, if you want to track whether you're home or away, you might use:
DataStore.myHomeLocationStatus
Using clear, descriptive names will make your DataStores easier to understand and maintain.
Set or update a value
DataStore.myHomeLocationStatus = "entered";
This creates the key and sets its value the first time the Applet runs. On subsequent runs, it updates the value.
Get a stored value
let status = DataStore.myHomeLocationStatus;
If the key hasn’t been set yet, it will be treated as an empty string.
Delete a value
delete DataStore.myHomeLocationStatus;
This removes the stored value.
Use the value in logic
if (DataStore.myHomeLocationStatus === "entered") {
SomeAction.skip();
}Using DataStore as an Ingredient
After creating a DataStore value it can be used as an ingredient in Query and Action fields. To do so, press Add ingredient, select DataStore from the dropdown, then select the ingredient of your choice from the list.
Key and value limits
- You can store multiple values using different keys
- Key names can be up to 100 characters
- Total storage is limited to 4KB per account
- Values must be JSON-serializable (strings, numbers, booleans, arrays, objects, etc.)
- Storing unsupported types (like functions) will result in an error
Examples
Example 1: Only run an Action when you're away
Use case:
If you'd like to get a phone call when your security camera detects motion, but only when you're not home, you can use DataStore to track your location status. One Applet can store whether you're home or away, and another Applet can use that value to skip the Action when you're home.
Applet 1: Track home or away status
- Trigger: Location Service, You enter or exit an area
- Filter code:
DataStore.myHomeLocationStatus = Location.enteredOrExited;
// Optional: skip the notification if you don't need it, or delete the following skip code to receive a notification when the Applet runs
IfNotifications.sendNotification.skip();
- Action: Notifications service → Send a notification from the IFTTT app
This stores "entered" or "exited" depending on your location.
Note: Every Applet must include an Action. In this case, the notification is only used to allow the Applet to run and update the stored value. You can skip it using Filter code if you don’t want to receive a notification.
Applet 2: Skip Action if you're home
- Trigger: Arlo Service, Motion Detected
- Filter code:
if (DataStore.myHomeLocationStatus === "entered") {
PhoneCall.callMyPhone.skip("You're home, skipping alert.");
}With this setup, Applet 1 tracks whether you most recently entered or exited the geofence and updates the DataStore.myHomeLocationStatus value. Applet 2 then checks that value, and if it’s "entered" (meaning you’re home), it skips the phone call Action.
Example 2: Add a cooldown to an Applet
Use case:
If you’re posting updates from a busy source (like an RSS feed or social account), you may want to limit how often your Applet runs. With DataStore, you can track the last time the Applet ran and skip Actions that happen too soon after.
Applet: Post with a 6-hour cooldown
- Trigger: RSS feed, New feed item
- Filter code:
let currentEntryTime = new Date(Feed.newFeedItem.EntryPublished).getTime();
let lastRunTime = DataStore.lastRunTimestamp;
if (!lastRunTime) {
// First run: store the current timestamp and allow the Action
DataStore.lastRunTimestamp = Feed.newFeedItem.EntryPublished;
} else {
let lastRunDate = new Date(lastRunTime).getTime();
let hoursSinceLastRun = (currentEntryTime - lastRunDate) / 3600000;
if (hoursSinceLastRun < 6) {
Twitter.postNewTweet.skip("Rate limit: Less than 6 hours since last post.");
} else {
// More than 6 hours have passed: update the stored timestamp
DataStore.lastRunTimestamp = Feed.newFeedItem.EntryPublished;
}
}
With this setup, the Applet stores the timestamp of the last time it ran in DataStore.lastRunTimestamp. Each time a new feed item is detected, it compares the current time to the stored value. If less than 6 hours have passed, the Action is skipped. If more than 6 hours have passed, the Action runs and the stored timestamp is updated.
When should I use DataStore?
DataStore is useful anytime your Applet needs to remember information between runs.
Common use cases include:
- Tracking state (home vs away, on vs off)
- Limiting how often an Action runs
- Storing timestamps or counters
- Sharing data between multiple Applets