A lesson is completed when you tick it, when you watch its video to the end or when you score 80% on its quiz. The certificate is issued online after the final assessment, from a score of 32 out of 40.
Lesson 8, module 2: What your tools can already do Google Apps Script, a guided reading: getting AI to write a script and understanding it A script you didn't write, you can still understand.
An Apps Script lives in your spreadsheet and acts with your account. [Diagram: What makes up a script] The spreadsheet The function The services The trigger Ask for comments in French, drafts, and a tracking column. Request: Write an Apps Script that prepares a reminder draft for each overdue invoice in the Suivi sheet, without sending anything, and records the date in column G. Reply: A script of about thirty lines, commented, that skips rows already paid or chased and creates drafts with GmailApp.createDraft. Read it with three questions: what does it read, write, send? Reads: the Suivi sheet Writes: column G Sends: nothing, drafts only First run: Google asks for authorisation. Read what you're granting. Access to your spreadsheets Full access to Gmail Revocable from your Google account Test on a copy, twice in a row: the second run mustn't redo anything. [Diagram: Testing a script on a copy] 1. Copy the spreadsheet 2. Run 3. Check 4. Run again In the exercise, you get AI to prepare a training provider's joining instructions. Your turn: A training provider's joining instructions The written lesson, the corrected exercise and the quiz are below the video.
Lesson 8 of 50 · module 2, what your tools can already do
Google Apps Script with guided reading: have an AI write a script and understand it
Apps Script is Google Workspace’s free automation tool: a script attached to your spreadsheet prepares emails, fills in columns or runs on its own every Monday. You don’t need to know how to code: you have an AI write it, provided you read it line by line, test it on a copy and know what access it has.
28 min of reading
1 min 45 of video
6 diagrams
3 demandes to copy
3 exemples pratiques
4 exercices answerss
5 questions
1 ressource
By the end of this lesson, you will know how to
Write the request that gets an AI to write a safe Apps Script script
Read a script line by line and identify what it reads, what it writes and what it sends
Install, authorise, test and then schedule a script without putting data at risk
What’s covered
What Apps Script can do, and within what limits
Have an AI write the script
Read the script line by line
Paste, authorise, test on a copy
Run it automatically every Monday
3 worked examples, followed from start to finish
Exercise with answers · Joining instructions at a training organisation
3 practice exercises, from guided to demanding cases
The quiz
Key points
Apps Script is Google Workspace’s free automation tool: a script attached to the spreadsheet, which acts with the account of whoever authorises it.
A safe request names the sheet and columns, forbids sending and deleting, and requires a tracking column and comments in French.
Read every script with three questions in mind: what does it read, what does it write, what does it send or delete?
Test on a copy, twice in a row: the second run must not redo anything.
A trigger runs under its creator’s account, and failures arrive in a “Summary of failures for Apps Script” e-mail.
If your business works in Google Workspace (Gmail, Google Sheets, Drive, Calendar), the equivalent of Power Automate is called Apps Script: a language (JavaScript) and an editor built into Google, with no extra subscription. It has no visual designer, and that is where AI changes everything. It writes the script; your job is to brief it precisely, then read the result well enough to know what it will do with your data. This lesson won’t make you a developer: it teaches you never to run a script you don’t understand.
What Apps Script can do, and within what limits
A script attached to a Google Sheets spreadsheet can read and write its cells, prepare or send e-mails with Gmail, create calendar events, file documents in Drive, and run on its own at a set time thanks to a trigger. It acts with the account of the person who authorised it. Google sets daily quotas, lower for a free account than for a Workspace account, and warns that they may change at any time, without notice.
The Apps Script quotas that matter for SMEs (as of 15 November 2026)
Quota
Free account (gmail.com)
Google Workspace account
Email recipients per day
100
1 500
Total trigger runtime per day
90 minutes
6 heures
Duration of one run
6 minutes
6 minutes
Triggers per user and per script
20
20
What makes up an attached script
The spreadsheet
The Google Sheets file the script is attached to, and its sheets.
The function
One named block, preparerRelances, which runs from top to bottom.
The Google services
SpreadsheetApp for the spreadsheet, GmailApp for Gmail, Utilities for dates.
The trigger
What starts the function: a click, opening the file, or every Monday at 8am.
The permissions
What the script is allowed to touch, granted once by your account.
A script reads like an automation sheet: the trigger, the data, the decisions, the actions.
Have an AI write the script
A script written by AI is only as safe as the request behind it. Five requirements make all the difference: the exact name of the sheet and columns, what the script must never do (send, delete), a tracking column that stops the same row being processed twice, comments in French on every block, and a separate explanation of what the script reads, writes and sends. The request below works with ChatGPT, Claude, Gemini or Copilot.
The request that gets a readable script written
You are a Google Apps Script developer writing for someone who doesn’t code.
Context: a Google Sheets spreadsheet, sheet “[Suivi]”. Row 1: headers. Columns: A [Client], B [E-mail], C [Invoice no.], D [Amount incl. VAT, currency format], E [Due date, a date], F [Paid, “oui” or “non”], G [Reminder prepared on, empty to begin with].
Task: write a function preparerRelances that, for each row whose due date has passed, whose “Paid” is not “oui” and whose column G is empty, creates a Gmail reminder DRAFT to the client, then writes today’s date in column G.
Constraints: never send an e-mail, delete or modify nothing other than column G, skip rows without an address or a valid date, write the amount exactly as displayed in the cell, the date in DD/MM/YYYY format, Paris time. Comment each block in French. 40 lines maximum.
After the script, explain in three short lists what it reads, what it writes and what it sends, then the permissions it will request on first run.
Roughly what you should get
A script of about thirty lines, close to the one in the next part, then three lists (reads: the Suivi sheet; writes: column G; sends: nothing, it creates drafts) and the permissions it will ask for: spreadsheets and Gmail. If the script contains sendEmail, deleteRow or clear, reject it and ask again.
Read the script line by line
The reminder script, to paste into the Apps Script editorJavaScript
/**
* Prépare un brouillon Gmail de relance pour chaque facture échue, payée « non », pas encore relancée.
* Feuille « Suivi » : A Client | B Courriel | C N° facture | D Montant TTC | E Échéance | F Payée | G Relance préparée le
*/
function preparerRelances() {
const feuille = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Suivi');
const plage = feuille.getDataRange();
const valeurs = plage.getValues(); // les valeurs brutes : de vraies dates
const affichees = plage.getDisplayValues(); // le texte affiché : « 1 250,00 € »
const debutDuJour = new Date();
debutDuJour.setHours(0, 0, 0, 0);
let nombre = 0;
for (let i = 1; i < valeurs.length; i++) { // i = 1 : la ligne 1 contient les en-têtes
const [client, courriel, numero, , echeance, payee, relanceLe] = valeurs[i];
// Lignes ignorées : payée, déjà relancée, sans adresse, sans date, ou pas encore échue
if (String(payee).toLowerCase() === 'oui' || relanceLe || !courriel) continue;
if (!(echeance instanceof Date) || echeance >= debutDuJour) continue;
const montant = affichees[i][3];
const date = Utilities.formatDate(echeance, 'Europe/Paris', 'dd/MM/yyyy');
const objet = 'Facture ' + numero + ' - rappel';
const corps = 'Bonjour,\n\nSauf erreur de notre part, la facture ' + numero + ' de ' + montant +
' TTC, échue le ' + date + ', reste à régler.\n\nPouvez-vous nous indiquer la date de règlement prévue ?' +
'\n\nBien cordialement,\n[Prénom Nom]\n[Entreprise] - [téléphone]';
GmailApp.createDraft(courriel, objet, corps); // un BROUILLON : rien ne part sans vous
feuille.getRange(i + 1, 7).setValue(new Date()); // colonne G : date de préparation
nombre++;
}
console.log(nombre + ' brouillon(s) préparé(s) pour : ' + SpreadsheetApp.getActiveSpreadsheet().getName());
}
Methods checked on 15 November 2026 in the Apps Script reference: SpreadsheetApp, Range.getValues and getDisplayValues, Utilities.formatDate, GmailApp.createDraft. Replace the square brackets in the signature.
The guided read-through, block by block
What you read
What it does
What you check
getSheetByName('Suivi')
Opens the sheet by name
The exact name of your tab, including accents and capitals
getValues() and getDisplayValues()
Reads the whole table twice: the actual dates, and the displayed text of the amounts
That your data starts in A1, with no title rows above the headers
for (let i = 1; …)
Goes through the rows one by one, skipping row 1
That row 1 does contain the headers
if (paid, already chased or no email) continue;
Skips the row if it is paid, already chased or has no address
That “yes” is written exactly like that in your column F
echeance >= debutDuJour
Skips invoices that are not yet due
That column E contains real dates, not text
GmailApp.createDraft(…)
Creates a draft in your Gmail, without sending it
That sendEmail appears nowhere
getRange(i + 1, 7).setValue(new Date())
Writes today’s date in column G of the row processed
That column 7 is indeed column G, and the only one written to
Paste, authorise, test on a copy
Install and run the script for the first time
Make a copy of the spreadsheet (File › Make a copy) and keep five test rows, including one paid, one with no address and one already chased.
In the copy, open Extensions › Apps Script: the editor opens in a new tab, with a Code.gs file.
Delete the contents, paste the script, then click the save icon.
In the function list at the top of the editor, choose preparerRelances, then click Run.
Google displays the authorisation request: choose your account, read the access requested (spreadsheets, Gmail) and accept only if you have read the script.
Read the execution log at the bottom of the editor: “2 draft(s) prepared” if two test rows are overdue and haven't had a reminder.
Open Gmail › Drafts, review each reminder, then run it a second time: the log should show 0.
Test a script on a copy
1Prepare the copy
Five test rows: overdue, paid, no address, already chased, future.
2Run
Read the log: the expected number of drafts.
3Check
Review the drafts in Gmail and column G.
4Chase
Second run: zero drafts, otherwise fix it.
The second run is the most useful test: it proves that the tracking column prevents duplicates.
Run it automatically every Monday
A time-driven trigger runs the function for you. You set it up from the editor’s Triggers menu (the alarm-clock icon on the left, then “Add trigger” at the bottom right: the function, the “Time-driven” source, the weekly type, Monday, the 8am–9am slot), or with the short function below, run once only. Both methods give the same result.
Install the Monday trigger in codeJavaScript
/** À exécuter une seule fois : lance preparerRelances chaque lundi, entre 8 h et 9 h (fuseau du projet). */
function installerDeclencheur() {
// Supprime d'abord un éventuel déclencheur existant, pour ne jamais en avoir deux
ScriptApp.getProjectTriggers()
.filter(function (d) { return d.getHandlerFunction() === 'preparerRelances'; })
.forEach(function (d) { ScriptApp.deleteTrigger(d); });
ScriptApp.newTrigger('preparerRelances')
.timeBased()
.onWeekDay(ScriptApp.WeekDay.MONDAY)
.atHour(8)
.create();
}
Syntax checked on 15 November 2026 in the guide to installable triggers (ScriptApp.newTrigger, timeBased, onWeekDay, atHour).
Two Google rules to know. An installable trigger always runs with the account of the person who created it: if they leave the company, the script stops with their account. And if it fails, Apps Script sends that person an email titled “Summary of failures for Apps Script”, with a link to fix or disable the trigger: this email must not end up in a filter that archives it.
Store a key outside the code, in the script propertiesJavaScript
// Une clé d'API ne s'écrit jamais dans le script : quiconque peut lire le fichier la lirait.
// 1. Dans l'éditeur : Paramètres du projet › Propriétés du script › ajouter CLE_API et sa valeur.
// 2. Dans le script, lisez-la ainsi :
function lireCle() {
const cle = PropertiesService.getScriptProperties().getProperty('CLE_API');
if (!cle) throw new Error('Propriété CLE_API absente : voir Paramètres du projet.');
return cle;
}
Script properties are managed from the project settings (50 at most through this page). Project editors can still read them, so limit who can edit the script.Apps Script, or another tool
1Is your data in Google Sheets, Gmail or Drive?
No Microsoft 365: Power Automate. Several software packages: a platform.
2Does the script fit on one page that you can read through?
No A visual flow in Make or n8n will be easier to take over.
3Could someone else take it over while you’re on holiday?
No Automation sheet and guided reading to hand over first.
Yes to allApps Script fits: have it written, read it, test it on a copy.
Apps Script is the right tool when the data is already in Google and someone in the company can review the script.
Have an inherited script explained before touching it
I don't code. Here is an Apps Script script I found in one of the company's spreadsheets: [paste the script, after removing any keys or sensitive addresses].
Explain it to me block by block, in plain English. Then give me three lists: what it reads, what it writes or changes, and what it sends or deletes. Flag any line that sends an email, deletes a row or a file, calls an external web address or contains something that looks like a key. Don't rewrite it.
Roughly what you should get
A block-by-block explanation, three lists, and the risky lines quoted verbatim (for example a sendEmail, a deleteRow, a UrlFetchApp.fetch to an external address). Check each flagged line yourself in the editor.
Mistakes to avoid
Pasting a script found on a forum into the editor and accepting every authorisation without reading it.
The access granted often covers the account's entire mailbox and all its files. A script can delete rows, send emails or pass data to an external address.
Have an AI explain the script block by block, look for sendEmail, deleteRow, clear and UrlFetchApp, and only authorise a script you can describe in three lists: what it reads, writes and sends.
Running the first test directly on the real spreadsheet.
A badly written condition can write to the wrong column or prepare a hundred drafts at once. The working spreadsheet keeps the marks, and everything has to be undone by hand.
File › Make a copy, five test rows chosen to trip up the script, two runs in a row, and only then the real spreadsheet.
Accepting a script with no tracking column, which processes every row meeting the condition each time it runs.
On the first Monday, all goes well. On Tuesday, the same reminders are prepared a second time; if the script sends them, the client receives the same email twice.
In your request, insist on a “processed on” column written by the script and checked before each run. The second-run test proves it.
Writing an API key or a password in plain text in the script, “to make it work”.
Anyone who can open the script can read it, and a copy of the spreadsheet takes the key with it.
Store the key in the script properties (Project settings › Script properties) and read it with PropertiesService. Limit the project's editors.
3 SME situations followed from start to finish: the prompts exactly as they were written, the model answer to aim for, and what was checked before sending.
Example 1
Invoice reminders at an events equipment hire company
Patrick runs a 7-employee events equipment hire company (marquees, tables, crockery) in Saint-Médard-en-Jalles, on Google Workspace. He tracks his invoices in Google Sheets. Reminders go out when he remembers, often a month too late.
Monday morning reminders
1Monday 8am
The trigger runs the script.
2Reading the spreadsheet
Overdue invoices, unpaid, not yet chased.
3Gmail drafts
One per invoice, with amount and date included.
4Review
Patrick adjusts and sends.
Request 1
The request from the lesson, adapted: sheet “Factures 2026”, columns A Client, B Email, C Invoice no., D Amount incl. VAT, E Due date, F Paid, G Reminder prepared on; signature “Patrick, [company] - [phone]”.
Model answer
The reminder script, with getSheetByName('Factures 2026'), followed by three lists. Reads: the Factures 2026 sheet, columns A to G. Writes: column G, row by row. Sends: nothing; creates Gmail drafts. Permissions requested: see and edit your spreadsheets; read, compose and send Gmail emails.
Patrick searches the script for sendEmail, deleteRow and clear: none. He notes that the Gmail permission is broad, and decides to keep the script in a spreadsheet where he is the only editor.
Request 2
Run on a 6-row copy, then review of the drafts.
Model answer
Log: “2 draft(s) prepared for: Copie de Factures 2026”. Draft: “Hello, Unless we are mistaken, invoice 2026-087 for €1,380.00 incl. VAT, due on 31 October 2026, is still outstanding. Could you let us know when you expect to pay it? Kind regards, Patrick”. Second run: “0 draft(s) prepared”.
He finds the tone a little curt for a loyal caterer: he adds a column H “Tone” (friendly or firm), asks the AI again for text that depends on it, then retests.
What was checked before sending
Facts and figures: every amount and every date in the drafts checked against the spreadsheet row.
Deliberate error: a due date written as text (“end of October”) is correctly ignored.
A second run with no duplicates before setting up the Monday trigger.
Order of magnitude: Monday reminders in ten minutes of review instead of an hour of writing, and invoices chased one day after the due date instead of 30.
Example 2
Sailing school course bookings flagged to the team
Camille is the administrative manager of a sailing school with 3 permanent staff in Arcachon. Course bookings come in through a Google Forms form linked to a spreadsheet. The instructors want to know the same evening who is coming, with their age and level, so they can prepare the boats.
From registration through to the instructors
1Form submitted
By a parent, from the school's website.
2Line added
In the sheet linked to the form.
3Trigger
When the form is submitted.
4Internal email
To moniteurs@, four pieces of information.
Request 1
Write an Apps Script function signalerInscription(e) for an installable “on form submit” trigger on the spreadsheet. It reads e.namedValues (the responses by question title: “Nom du stagiaire”, “Âge”, “Niveau”, “Stage choisi”) and sends an INTERNAL email to moniteurs@[ecole].fr with these four pieces of information. No other recipient possible. Comments in French.
Model answer
function signalerInscription(e) {
// e.namedValues : les réponses du formulaire, rangées par intitulé de question
const r = e.namedValues;
const texte = 'Nouvelle inscription : ' + r['Nom du stagiaire'][0] + ', ' + r['Âge'][0] + ' ans, niveau ' +
r['Niveau'][0] + ', stage ' + r['Stage choisi'][0] + '.';
// Destinataire fixe : l'équipe interne, jamais l'adresse saisie dans le formulaire
MailApp.sendEmail('moniteurs@[ecole].fr', 'Inscription - ' + r['Stage choisi'][0], texte);
}
Here, sending directly is acceptable: the email stays within the team, which is the green level. Camille checks that the address is hard-coded and never comes from the form.
Request 2
Installed from the Triggers menu: function signalerInscription, source “From spreadsheet”, type “On form submit”. Tested with a dummy booking entered by Camille.
Model answer
Email received by moniteurs@: “New booking: Léo Martin, 11, beginner, Optimist course 2 to 6 April.”
The question titles must stay the same: Camille writes this on the sheet and in the form description.
What was checked before sending
Fixed recipient checked in the script: no address comes from the form responses.
Test with a question deliberately renamed: the script fails and the “Summary of failures” e-mail does arrive.
Children’s personal data limited to first name, surname, age and level, needed for safety on the course.
Order of magnitude: no more copying out the list in the evening, and instructors notified within a minute.
Example 3
The summary of upcoming deadlines at a land surveying firm
Olivier is an assistant at an 18-employee firm of chartered land surveyors in Libourne. The filing deadlines for cases (boundary surveys, land divisions) are in a shared spreadsheet. Every Monday, he goes through them all to warn the engineers: half an hour lost.
Olivier's Monday, before and after
Before
Checking the whole spreadsheet
Individual messages to the engineers
Overdue cases spotted too late
After
A summary at 7am
Overdue cases at the top
A one-minute check
Request 1
Script requested from the AI: a recapEcheances function that reads the “Dossiers” sheet (A Case no., B Municipality, C Engineer, D Deadline, E Status), keeps the cases not marked “Filed” whose deadline falls within the next 14 days, sorts them by date, and sends ONE summary email to the internal address bureau@[cabinet].fr. Trigger every Monday between 7am and 8am.
Model answer
What the email received on Monday looks like: “Files due within 14 days (4): 17/11 - D-2026-118 - Saint-Émilion - Julie; 19/11 - D-2026-121 - Libourne - Marc; 24/11 - D-2026-109 - Coutras - Julie; 27/11 - D-2026-125 - Fronsac - Hugo.”
Olivier checks the list by hand on the first Monday: four cases, all correct. He then has cases that are already overdue added at the top, at his request.
Request 2
Follow-up request: “At the top of the email, add the files whose deadline has passed and whose status is not Submitted, under the heading OVERDUE. Change nothing else.”
Model answer
Script changed by six lines. At the top of the following Monday's email: “OVERDUE (1): 12/11 - D-2026-102 - Pomerol - Marc”.
He reviews only the six lines added, then reruns both tests: a Monday with nothing overdue, and a Monday with something overdue.
What was checked before sending
The first summary compared with a manual check of the spreadsheet.
Dates in DD/MM/YYYY format on Paris time, checked against a Monday case.
Internal e-mail only: green level, no review before sending.
Order of magnitude: half an hour a week, and above all no case discovered the day before its deadline.
Gaëlle is an assistant at a training provider with 9 staff in Bordeaux, on Google Workspace. Bookings are in a spreadsheet, “Inscriptions” sheet: A Surname, B First name, C Email, D Course, E Start date, F Location, G Joining instructions prepared on. Each trainee must receive their joining instructions seven days before the session starts. Gaëlle writes them one by one, and forgets some. Design the automation: the sheet, the request to the AI, the expected script, how to test it and how to schedule it every morning.
Fill in the automation sheet, with the level of control.
Write the request that will get an AI to write the script, with its constraints.
Read the corrected script and list what it reads, writes and sends.
Plan the test rows and the daily trigger.
See the answers
The “Prepare joining instructions 7 days ahead” sheet
Box
Content
Trigger
Every day, between 7am and 8am (daily time-driven trigger).
Data
Inscriptions sheet: first name, email, course, start date (date), location. Personal data: yes, trainees’ names and email addresses, which stay within Google Workspace.
Decisions
If the start date is exactly 7 days away AND column G is empty, then prepare the joining instructions. A row with no email or no valid date: skipped, and flagged by Gaëlle during her weekly review.
Actions
1. Create a Gmail draft of the joining instructions. 2. Write the date in column G. Account: Gaëlle’s.
Inspection
Amber level: Gaëlle reviews and sends the drafts every morning. Failures: “Summary of failures” email received by Gaëlle. Cover: the head of training, who has editor access to the spreadsheet.
The request to the AI
You are a Google Apps Script developer writing for someone who doesn’t code.
Context: sheet “Inscriptions”, row 1 headers, columns A Surname, B First name, C E-mail, D Course, E Start date (date), F Venue, G Joining instructions prepared on (empty to begin with).
Task: a function preparerConvocations that, for each row whose start date falls exactly 7 days from now and whose column G is empty, creates a Gmail DRAFT of joining instructions, then writes today’s date in column G.
Constraints: never send an e-mail, modify only column G, skip rows without an e-mail address or a valid date, date in DD/MM/YYYY format, Paris time, practical details left in square brackets. Comments in French, 40 lines maximum. Then say what the script reads, writes and sends.
Roughly what you should get
A script close to the one below, and the three lists: reads the Inscriptions sheet; writes column G; sends nothing, creates drafts.
The expected scriptJavaScript
/**
* Prépare un brouillon de convocation pour chaque stagiaire dont la session commence dans 7 jours.
* Feuille « Inscriptions » : A Nom | B Prénom | C Courriel | D Formation | E Date de début | F Lieu | G Convocation préparée le
*/
function preparerConvocations() {
const feuille = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Inscriptions');
const valeurs = feuille.getDataRange().getValues();
const cible = new Date();
cible.setHours(0, 0, 0, 0);
cible.setDate(cible.getDate() + 7); // la date du jour + 7 jours, à minuit
let nombre = 0;
for (let i = 1; i < valeurs.length; i++) { // la ligne 1 contient les en-têtes
const [nom, prenom, courriel, formation, debut, lieu, preparee] = valeurs[i];
if (preparee || !courriel || !(debut instanceof Date)) continue;
const jour = new Date(debut);
jour.setHours(0, 0, 0, 0);
if (jour.getTime() !== cible.getTime()) continue; // seulement les sessions à J+7
const date = Utilities.formatDate(debut, 'Europe/Paris', 'dd/MM/yyyy');
const corps = 'Bonjour ' + prenom + ',\n\nVous êtes inscrit(e) à la formation « ' + formation +
' », qui débute le ' + date + ' à 9 h, ' + lieu + '.\n\n[Informations pratiques : accès, repas, matériel]' +
'\n\nÀ bientôt,\n[Prénom Nom]\n[Organisme] - [téléphone]';
GmailApp.createDraft(courriel, 'Convocation - ' + formation + ' - ' + date, corps);
feuille.getRange(i + 1, 7).setValue(new Date()); // colonne G : date de préparation
nombre++;
}
console.log(nombre + ' convocation(s) préparée(s)');
}
Test rows: one session 7 days ahead (joining instructions expected), one 6 days ahead and one 8 days ahead (nothing), one 7 days ahead with no email (nothing), one 7 days ahead with G already filled in (nothing).
Two runs in a row: one set of joining instructions the first time, none the second.
A limit to be aware of: a session entered less than 7 days before it starts will not get automatic joining instructions. Gaëlle prepares them by hand, and notes this on the sheet.
Practise
Three more exercises, from the most guided to the most demanding. The material is provided in full: copy it into your tool, then check your work against the criteria before opening the answers.
Level 1 · guided10 min
Say what a script does without running it
Here is a script found in the spreadsheet of a 20-employee accountancy firm in Mérignac. Without running it, answer: what does it read, what does it write or modify, what does it send or delete? Which line stops you? You don’t need any account for this exercise.
The material to work on
function nettoyer() {
const f = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Pièces');
const v = f.getDataRange().getValues();
// Parcourt le tableau du bas vers le haut
for (let i = v.length - 1; i >= 1; i--) {
if (v[i][4] === 'Saisie') {
f.deleteRow(i + 1);
}
}
MailApp.sendEmail('associes@[cabinet].fr', 'Nettoyage fait', 'Lignes saisies supprimées.');
}
Check your work
Reads: the Pièces sheet, column E (fifth column)
Changes: deletes every row whose column E is “Entered”
Sends: an internal email to the partners
You flag deleteRow as the risky line, with no backup or trace
See the answers
The script reads the “Pièces” sheet, goes through the rows from bottom to top (so that deleting one row doesn't shift the next ones) and permanently deletes every row whose fifth column is “Entered”. It then sends an internal email. Nothing keeps a record of what was deleted: one wrong status wipes a document from the tracker.
The request for a safer version
Rewrite this Apps Script script so that, instead of deleting the rows whose column E is “Entered”, it copies them to an “Archive” sheet (created if it doesn't exist) with today's date, and only then deletes them from “Pièces”. The email to the partners must state the number of rows archived. Comments in English: [paste the script].
Roughly what you should get
A script that archives before deleting, and an e-mail along the lines of “12 rows archived in the Archive sheet”. Test it on a copy.
Level 2 · independent20 min
Add an exception to the reminder script
The accountant at an 11-employee landscaping company in Gradignan uses the reminder script from the lesson. She adds a column H, “Dispute”: when it contains “yes”, no reminder should be prepared, since the invoice is disputed. Write the request to the AI, then the line or lines to change in the script, and the test that proves the fix works.
The material to work on
Extract from the spreadsheet, Suivi sheet (columns A to H):
Client | Email | Invoice no. | Amount incl. VAT | Due date | Paid | Reminder prepared on | Dispute
SCI des Pins | gestion@[sci].fr | 2026-201 | €2,160.00 | 15/10/2026 | no | | yes
Mairie de [commune] | compta@[mairie].fr | 2026-188 | €4,800.00 | 30/09/2026 | no | | no
M. Durand | [email] | 2026-215 | €640.00 | 05/11/2026 | no | |
Check your work
The request states exactly what to add and forbids changing anything else
Reading column H is added to the line that splits up the spreadsheet row
The condition skips the row when H is “yes”, regardless of capitalisation
The expected test: no draft for SCI des Pins, a draft for the other two
See the answers
The request to the AI
Here is my Apps Script reminder script: [paste the script]. I’ve added a column H “Litige”. Change the script so that it skips any row where column H is “oui” (upper or lower case). Change nothing else. Show me only the modified lines, with their line numbers, then the full script.
Roughly what you should get
Two lines changed: the line splitting, which reads column H, and one extra condition.
The two lines changedJavaScript
// 1. Le découpage lit maintenant la huitième colonne (H)
const [client, courriel, numero, , echeance, payee, relanceLe, litige] = valeurs[i];
// 2. Nouvelle condition, juste après celle des lignes payées : une facture en litige n'est jamais relancée
if (String(litige).toLowerCase() === 'oui') continue;
Test on a copy with the three rows from the handout: the log should show “2 draft(s) prepared”, for the town hall and for Mr Durand, none for SCI des Pins. Second run: zero.
Level 3 · demanding case35 min
Turn down automatic sending, and propose something better
The manager of a 40-employee home care association in Talence, on a free gmail.com account, asks for a script that automatically sends an appointment reminder every morning to the 180 clients visited the next day, based on the schedule in Google Sheets. Write your reply to the manager: the automation sheet, what cannot work as it stands and why, the level of control, and a proposal that works, with the request to the AI.
The material to work on
Message from the manager: “Every evening, Mélanie calls or writes to all of the next day's clients to confirm what time the home carer will arrive. It takes her two hours. I want this automated: a script that sends each of them an email every morning at 7am, from the Planning tab (columns: Client, Email, Phone, Date, Time, Carer). Lots of them don't have an email address, but that doesn't matter. Can you set it up this week?”
Check your work
You spot the free account’s quota of 100 recipients a day, which rules out 180 messages
You point out that clients without an e-mail address would not be notified
You rate the sending as amber level (a message to people, often elderly, about a time)
You suggest a safe first step: drafts or a prepared call list
Your request to the AI requires drafts and a tracking column
See the answers
What doesn’t work as it stands
Update
Why
180 emails a day from gmail.com
Apps Script limits a free account to 100 recipients a day; the script would fail around halfway down the list
Recipients with no email address
They would not be notified, and nobody would notice; yet they are often the most vulnerable
Sending without review
A wrong time in the schedule would go straight out to an elderly person: amber level at least
The proposal: a script that, every evening at 5pm, prepares drafts for the clients who have an email address, and writes the list of those who don't, with their phone number and time, in an “Appels de demain” (tomorrow's calls) tab. Mélanie reviews and sends the drafts, then makes her calls from a ready-made list. Realistic saving: half of her two hours. Moving to Google Workspace (1,500 recipients a day) or to an SMS tool can be discussed afterwards, with figures to hand.
The request to the AI
You are a Google Apps Script developer writing for someone who doesn’t code.
Context: tab “Planning”, row 1 headers, columns A Client, B E-mail, C Phone, D Date (date), E Time (text), F Carer, G Reminder prepared on (empty to begin with).
Task: a function preparerRappels that, for each row whose date is tomorrow and whose G is empty: if B contains an address, creates a Gmail reminder DRAFT (“Hello, [Carer] will visit tomorrow [date] at [time]. If you can’t make it, call [association’s number].”); otherwise, adds the row (client, phone, time, carer) to the “Appels de demain” tab, cleared at the start of each run. In both cases, write today’s date in G.
Constraints: never send an e-mail, modify only column G and the “Appels de demain” tab. Comments in French, 40 lines maximum. Then say what the script reads, writes and sends.
Roughly what you should get
A script of about forty lines and its three lists. Tests: a client with an e-mail address, one without, a row for the day after tomorrow, a row already processed.
All the course prompts to copy, both for the assistant that helps you build and for the AI step of a flow, including answers, practical examples and practice tasks, sorted by module and lesson, with filters to find the right one.
For each lesson, the main exercise and the three graded practice tasks with their materials, to do on paper or alongside your automation platform; all the answers are grouped at the end.
The course’s practical examples, job by job: the situation, the prompt as it was written, the model answer and what was checked before letting the flow run.
All the lessons in a single PDF: objectives, written course with its diagrams, tables and requests, common mistakes, exercise and key takeaways. The practice exercises and answers are in the workbook, the examples in the collection.
Your notes stay on this device; they are not sent anywhere.
A question for the tutor
A result that doesn’t match the model answer, a prompt that gets you nowhere, a case specific to your business: write to us with your prompt and the response you got. A Bonbay Académie trainer replies within 24 working hours, on your case.