You can! Using conditional logic and multiple criteria, you can customize when your automation will run.
To get started, create your own Applet, or automation, by adding a trigger and at least one action.
After you do, click the Plus sign between your Trigger and Action, the click add to the right of Filter.
The filter editor lets you write JavaScript to skip actions or update action fields on the fly.
For example, if you want an Applet to only run the action between 7am and 9pm you can add this filter:
let currentHour = Meta.currentUserTime.hour();
if (currentHour < 7 || currentHour >= 21) {
Email.sendMeEmail.skip();
}To only run an action at night you can modify the condition slightly:
if (currentHour > 7 && currentHour < 21)Keep in mind, you are setting the condition for when the Applet should skip an action! All actions run by default when the Applet's trigger fires.
To the right of the filter editor you have dropdown fields that show the data you have access to in the code:
If you want to skip two actions, copy and paste them in the code:
let currentHour = Meta.currentUserTime.hour();
if (currentHour < 7 || currentHour >= 21) {
Email.sendMeEmail.skip();
IfNotifications.sendNotification.skip()
}For more examples and ideas, check out our more in-depth articles on filters and queries.
For more flexibility, you can also use the AI filter generator to create a filter automatically by describing what you want your Applet to do.