โ08-09-2023 10:04 AM
Hi,
I would appreciate help on how to run a recipe Sat, Sun, and before 8:30am M-F and after 5:30pm M-Th and after 5:00pm F. I've tried to set trigger conditions based (below) but I'm having trouble handling the 1/2 hours (8:30, 5:30 times) and identifying the M-Th and F schedule from the entire week. Below is what limited progress I've made. I couldn't figure out any other way, I couldn't make the Schedular work nor with cron.
(CreatedDate.to_time.in_time_zone("America/New_York").wday == 0 ) ||
(CreatedDate.to_time.in_time_zone("America/New_York").wday == 6 ) ||
(CreatedDate.to_time.in_time_zone("America/New_York").strftime("%H").to_i < 8 ) ||
(CreatedDate.to_time.in_time_zone("America/New_York").strftime("%H").to_i > 17 )
Thank you in advance for sharing your time and knowledge.
J
Solved! Go to Solution.
โ08-09-2023 01:17 PM
Hi there,
I think indeed CRON is not possible as you have to exclude too specific moments.
The next best thing I could come up with, would be the following (trigger every x):
In task 2, I created the variables as following:
In task 3, the variable is created as following:
If special day and special hour is true then do nothing, else do what is needed.
I know I skipped the half hours but from the above mentioned logic you can deduct that, it would work similarly
โ08-10-2023 12:29 PM
Steven,
Your suggestions were excellent. You will see them sprinkled throughout the solution I came up with using your insights. I used a two-step filter approach to optimize use of the trigger to reduce cost. In the trigger condition I limited it to pulling down activities in the CRM (Insightly) that only occurred Sun, Sat and before 8am and after 5pm M, T, W, Th, Fri. Then at the next action I branched off 5pm - 5:30pm M, T, W, Th to stop and do nothing. While I found your "Created Variable" beneficial to understand your approach, I did not use them to avoid task cost. Thank you.
โ08-11-2023 06:52 AM
So here's how I solved the "before 8:30am Eastern time". I'm checking to see if the time the project is created is before 8:30am Eastern time on the same day. I'll bet there are more elegant solutions and would welcome anyone posting them.
(ProjectCreatedDatePill).to_time.in_time_zone("America/New_York") < (ProjectCreatedDatePill).to_time.in_time_zone("America/New_York").strftime("%Y-%m-%dT8:30:0%:z").to_time ).in_time_zone("America/New_York")
โ08-09-2023 01:17 PM
Hi there,
I think indeed CRON is not possible as you have to exclude too specific moments.
The next best thing I could come up with, would be the following (trigger every x):
In task 2, I created the variables as following:
In task 3, the variable is created as following:
If special day and special hour is true then do nothing, else do what is needed.
I know I skipped the half hours but from the above mentioned logic you can deduct that, it would work similarly
โ08-10-2023 12:29 PM
Steven,
Your suggestions were excellent. You will see them sprinkled throughout the solution I came up with using your insights. I used a two-step filter approach to optimize use of the trigger to reduce cost. In the trigger condition I limited it to pulling down activities in the CRM (Insightly) that only occurred Sun, Sat and before 8am and after 5pm M, T, W, Th, Fri. Then at the next action I branched off 5pm - 5:30pm M, T, W, Th to stop and do nothing. While I found your "Created Variable" beneficial to understand your approach, I did not use them to avoid task cost. Thank you.
โ08-10-2023 12:12 PM
Hi Jay,
Good to know that it helped you out and even better that you were able to reduce the overall task / job count! ๐
โ08-11-2023 06:52 AM
So here's how I solved the "before 8:30am Eastern time". I'm checking to see if the time the project is created is before 8:30am Eastern time on the same day. I'll bet there are more elegant solutions and would welcome anyone posting them.
(ProjectCreatedDatePill).to_time.in_time_zone("America/New_York") < (ProjectCreatedDatePill).to_time.in_time_zone("America/New_York").strftime("%Y-%m-%dT8:30:0%:z").to_time ).in_time_zone("America/New_York")