Filters lets you add custom JavaScript logic to your Applets. You can add a filter using IFTTT Chat or the classic composer. For an overview of filters and what you can do with them, see this guide.
Add a filter with IFTTT Chat
With IFTTT Chat, you can describe the logic you want to add to your Applet, and it can generate and add the filter for you.
For example, you could ask IFTTT Chat:
When my camera detects motion, send me a notification, but only if it's after 9 PM.
IFTTT Chat can create the Applet and add a filter that checks the current time before running the notification Action.
You can also ask IFTTT Chat to add a filter to an existing Applet. Describe the logic you want to add and include the name or Applet id of the Applet you'd like to edit.
Add a filter with the classic composer
Add a filter to a new Applet
To add a filter to a new Applet using the classic composer:
- Go to ifttt.com/create and select the Classic tab.
- Click Add to the right of If This, then add a Trigger to your Applet.
- Click Add to the right of Then That, then add an Action to your Applet.
- Between your Applet's Trigger and Action, click the first plus button (+), then click Add to the right of Filter.
- Write your own JavaScript or use one of the filter generators to get started.
When you're finished, click Create filter, then Continue and Finish.
Add a filter to an existing Applet
To add a filter to an existing Applet, go to ifttt.com/my_applets, click your Applet to view it, then click Edit Applet.
- Click the first plus button (+) between your Applet's Trigger and Action.
- Click Add to the right of Filter to access the filter editor.
- Write your own JavaScript or use one of the filter generators to get started.
When you're finished, click Create filter, then Update to save your Applet.
Available methods for your Applet's Trigger, Queries, and Actions
When you're writing a filter, the filter editor displays the available methods and data for your Applet's Trigger, Queries, and Actions on the right side of the editor. Click the dropdown arrow next to a method or data field to expand it and view more details.
The editor also includes methods available to all Applets, such as Meta.currentUserTime, Meta.triggerTime, and Meta.previousTriggerTime.
These available methods are specific to the services and Applet you're working with, so check the filter editor for the methods available to your Applet.
Filter generators
If you're not comfortable writing JavaScript, the filter editor includes several tools to help you generate code available under the Code generators heading.
You can choose from generators for common use cases or use the AI filter generator to create code based on what you want your Applet to do. Describe the logic you want to add, and the AI filter generator will generate the code for you.
For example, you could enter:
Only run this Action if the current temperature is above 80°F.
After generating the code, click Copy to clipboard to copy it, then paste it into the filter editor. When you're finished, click Add filter in the top right, then follow the remaining prompts to save your Applet.
Filters on mobile
Filters can also be viewed and edited in the IFTTT mobile app. For more information, see Can I add/edit filters in the IFTTT mobile apps?.