Scheduled Trigger Based on Day of Month
In order to schedule a trigger based on a weekday's placement in a month (ex/ first Monday and third Monday of the month), is the best route to use a trigger running every weekday and then have a field formula running initially to identify whether it's the first or third Monday of the month? if true, continue in the process. If false, end the process run.
I'm not seeing flexibility on the scheduled trigger itself to specify the day of the week (just keying off the start date and then calculating the recurring date from there based on defined frequency).
Let me know if anyone has a better way to accomplish this. Thanks in advance!
Best Answer
-
@Chris_401431 helped me with a field formula for this. The below can be used with the Field: Field Formulas action. Remove any lines starting with
//
. The formula will return "true" if the current day is the first or third Monday of the month, and "false" otherwise.var date = new Date(); // new Date() returns the current date var dayOfWeekNum = date.getDay(); var dayNumber = date.getDate(); result = false; // getDay() returns integers for days of the week. Monday corresponds to "1" if (dayOfWeekNum === 1) { // we know it's Monday, now to figure out if it's the first or third Monday if (dayNumber < 8 || (dayNumber >= 15 && dayNumber < 22)) { result = true; } }
From there, add a step for
Pushbot: End this Pushbot
with a condition for if the result is 'false' (not the first or third Monday of the month). Add conditions on the next step to start if the result is 'true' (first or third Monday of the month).1
Answers
-
@Meghan_153218 I think the cleanest, simplest way to manage this currently would be an imported table with the dates you know the process should run. Use a scheduled trigger to start the process each weekday. Use Dates: Get current date, and then Tables: Look up data in a column. If today's date is present in the table, proceed. If it is not, end.
1 -
@Meghan_153218 I like the idea of scheduling a trigger on more specific dates. In this context I have found some ideas in this community. Maybe we can vote for it together And in addition: are you able to merge ideas? Because the ones I found, sound pretty similiar:
https://community.pushbot.com/discussion/206/additional-options-for-scheduled-trigger
https://community.pushbot.com/discussion/428/scheduled-trigger-capability-for-first-business-day-of-month
https://community.pushbot.com/discussion/167/scheduled-trigger-complex-schedule-options0 -
@Christina_108366 - thanks for pointing all of those out! @Jeff_763648 do we want to consolidate the above 3 ideas that seem to be related for additional scheduled trigger capabilities?
0