Skip to content

Repetitive tasks and copy-paste

Every morning someone opens three files, copies yesterday’s rows into a report, fixes the dates and emails it out. It takes an hour, it is boring, and it breaks the day that person is away.

On this page: How it shows upWhy it happensWhat to controlA better workflowHow it worksRules and exceptionsAn example

How it shows up

You will probably recognise some of these:

  • The same steps are repeated daily or weekly, by hand.
  • Small errors — a missed row, a wrong date — appear regularly.
  • Only one person knows the exact steps.

Why it happens

Usually one or more of the following is behind it. Treat them as hypotheses to check against the real file and workflow, not as conclusions.

  • The steps were never written down, so they were never automated.
  • Source files change layout, which makes people fall back to manual work.
  • No one owns the process, only the task.

What to control

Fixing it starts with making a few things explicit, so everyone checks the same thing in the same way:

ControlWhat to check
Written procedureEach step, its input, output and timing.
Run logWhen the job ran, how many rows it processed, and whether it succeeded.
Duplicate guardA key that stops the same row from being copied twice.
Failure noticeWho is told, and how, when a run fails.

From today’s workflow to a better one

Today the work usually moves like this:

  1. Open each source file.
  2. Copy new rows into the report sheet.
  3. Fix formats and dates by hand.
  4. Email the report.

With a clear owner, status and record at each step, it becomes:

  1. A time-driven script reads new rows from each source.
  2. Rows are checked against a key and appended once.
  3. Formats are normalised by formulas, not by hand.
  4. The run is logged and the report is sent automatically.
  5. If a step fails, the owner gets an email instead of silence.

How it works in Google Workspace

Write the steps first. A short procedure shows which steps are mechanical and which need judgement. Only the mechanical ones are automated.

Formulas before scripts. QUERY, IMPORTRANGE and array formulas often remove the copy step with nothing to maintain.

Apps Script with time-driven triggers. When formulas are not enough, a scheduled script does the copy, the check and the email, and writes a line to a run log every time.

Rules and exceptions

The workflow only holds when its rules are written down:

  • A row is identified by its key; a key already copied is skipped.
  • Source layout changes are announced before they happen.
  • The script has one named owner.

And it needs a planned answer for the cases that do not fit:

  • A source is missing or empty: the run stops, logs it and notifies the owner.
  • A row fails validation: it goes to an exception tab instead of the report.

Where this stops working

Apps Script has execution-time and quota limits, and a script nobody owns becomes the next fragile step. Large volumes or many systems are better served by an integration or a database.

An example

Fictional example: a daily stock report built by hand in 50 minutes becomes a 6:00 scheduled run. The owner reads a one-line log and only steps in on the two or three days a month a source is late.

Names and figures in this example are fictional.

Google Sheets, Google Workspace and Looker Studio are trademarks of Google LLC. SOSMED-ID is an independent service and is not affiliated with Google.