Hey Makers
Ever wondered how to set up your scenarios so that they run on the very last day of the month?
Check out this step-by-step guide on how to do exactly that
The setup consists of 2 parts:
scheduled runs on 28,29,30 and 31 of each month
a filter that checks if it is actually the last day of the given month
1. Scheduling:
Set the schedule to 28,29,30 and 31 of every month.
2. Filter with functions after trigger module
Function for copypasta: {{formatDate(addDays(addMonths(setDate(now; 1); 1); -1); βDDβ)}}
How it works:
- setDate function sets the date to the 1st day of the current month
- addMonths function adds 1 month, taking us to 1st day of the next month
- addDays -1 subtracts 1 day, taking us to the last day of the current month
- formatDate with DD token gives us the number of the last day of the current month
- the result of the 4 functions above is then checked against the current date {{formatDate(now; βDDβ)}}
- scenario runs on 28,29,30 and 31 and checks if it is the last day of the month, if yes, it passes the filter woosh!
PS: A big shout-out to our support team for sharing this brain-teaser and to @Matous_Vrba for breaking it down for us