Creating scheduled and repeating tasks

How to schedule and repeat certain tasks at regular intervals.

Intro

Wouldn’t it be great if you could execute certain tasks automatically? Funnily enough, we’ve thought about that ;).

In this article, we’ll cover how to:

  • Use REFRESH(), REPEAT(), and SCHEDULE()
  • Use checkboxes with an automation function
  • Send scheduled emails

Let’s go 🚀!

Automation functions

At Rows, we have three automation functions - which one you choose to use all depends on what you want to do:

Do you want to...Then use....
Refresh data in a cell or range periodically. For example, every minute of every day.REFRESH()
Repeat a formula or cell periodically. For example, every hour of every day.REPEAT()
Schedule an action on specific days of the year and at specific times. For example, every Monday of June at 09:00.SCHEDULE()

REFRESH vs REPEAT

Generally, use REFRESH() whenever you can, and REPEAT() when you need to automate a function nested inside of another.

Automations in forms

Forms do not support REPEAT(), REFRESH(), and SCHEDULE() functions. You can always update the base spreadsheet inside the Rows editor and users will see the updated version of the Form when they refresh the page.

REFRESH

REFRESH() lets you refresh the data in a cell or range periodically. This is particularly handy if you have a range of cells where you’d like to trigger an update or a formula execution.

kb-function-refresh-svg

Let’s just quickly cover the interval, delay, and unit parameters:

ParameterMandatoryDescription
rangeYesCell or range to be refreshed periodically. For example: A3 or B1:B6.
intervalNoThe interval between cell or range refreshes. By default this is 60 (min). The minimum is 1 (min).
unitNoThe unit of time to use with the interval. Choose between:
- "min" for minutes (default)
- "h" for hours
- "d" for days
- "w" for weeks
- "m" for months
delayNoThe time until the first refresh. By default this is 1 (min). The minimum is 0 (min).
intervalNoThe unit of time to use with the delay. Choose between:
- "min" for minutes (default)
- "h" for hours
- "d" for days
- "w" for weeks
- "m" for months

REPEAT

REPEAT() lets you repeat the execution of a function (or a cell that contains a function) periodically. This automation function is great when you want to include the function within the actual formula, and not just refer to a cell. Its syntax is pretty similar to REFRESH().

kb-function-repeat

SCHEDULE

SCHEDULE() allows you to execute functions or cells at very specific times or intervals. This function is great when you need to execute a function at a specific time or day, such as every Monday of June at 11 am.

kb-function-schedule-svg

ParameterMandatoryDescription
taskYesThe formula or cell to execute. For example NOW(), A1, or B2:B7.
scheduleYesWhen and how often to execute the task. We use a special syntax for scheduling, which you can read about below.
time_zoneNoThe 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 parameter options and examples

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.

Incompatibility

Incompatible with REPEAT(), REFRESH(), and SCHEDULE()
FrequencyUseExample
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")

Spreadsheet practice

In our spreadsheet, we're going to add an automation where we send a daily email of all the searches that users perform. We're also going to conditionalize the schedule with a checkbox. If it's checked - we perform the automation, if it isn't, we don't.

  1. Go to your App Log table.
  2. In cell D1, create a Checkbox by going to More action elements and selecting Checkbox.
  3. In cell E1, type in this formula:

kb-int-schedule-email

❇️ Done! Now, when the checkbox is checked, we'll send an email every day at 09:00 with the full log of search queries. Cool right?