Dashdash functions: SCHEDULE()

Schedule Function

Overview

The SCHEDULE()function lets you automate how often to trigger another function or cell. This is particularly useful if you want to call an API every day at certain hour, or scrape new LinkedIn job openings on the fourth day of every month.


Syntax

SCHEDULE(task, schedule_message, [time_zone])

Parameter Mandatory Description
task Yes The formula or cell to execute.
schedule Yes When and how often to execute the task. We use a special syntax for scheduling. Please see the schedule section.
time_zone No The UTC or GMT timezone in HH:MM to use when evaluating schedule_message. For example: Indian Standard Time (IST) = "UTC+05:30". By default, this is set to UTC.

schedule

Use the following syntax in the schedule_message parameter:

Frequency Use Example
Every X minutes “every X minutes” SCHEDULE(NOW(), "every 5 minutes")
Every X hours “every X hours” SCHEDULE(NOW(), "every 1 hours")
Every X minutes within a time period “every X minutes from HH:MM to HH:MM” SCHEDULE(NOW(), "every 5 minutes from 10:30 to 20:30")
Every X hours within a time period “every X hours from HH:MM to HH:MM” SCHEDULE(NOW(), "every 2 hours from 09:00 to 21:00")
Every day a specified time “every day HH:MM” SCHEDULE(NOW(), "every friday 15:00")
Every given weekday at a specified time “every weekday HH:MM” SCHEDULE(NOW(), "every day 15:00")
Every given weekday for certain months at a specified time “every weekday of month HH:MM” SCHEDULE(NOW(), "every friday of march,april 15:00")
More than one weekday at a specified time “every weekday1,weekday2 HH:MM” SCHEDULE(NOW(), "every monday,tuesday 09:00")
Every X day of a month at a given time “every day of the month of month HH:MM” SCHEDULE(NOW(), "every 1 of month 18:00")
More than one day of a month at a given time “every day of the month1, day of the month2 of month HH:MM” SCHEDULE(NOW(), "every 1,2 of month 19:00")
More than one day of a month for certain months at a given time “every day of the month1, day of the month2 of month1,month2 HH:MM” SCHEDULE(NOW(), "every 1,2 of january,february 19:00")

:memo: Note: Acceptable Parameters for schedule_message

For numbers (including time and date), use the cardinal number in numeral form. For example: 1, 14, 28.

For days of the week and months, use the full name in lowercase. For example: monday, wednesday, sunday, february, december.

:memo: Note: Incompatible with REPEAT(), REFRESH(), and SCHEDULE()

The SCHEDULE() function cannot be used in conjunction with REPEAT(), REPEAT(), or SCHEDULE().


7 Likes