Course material, available in Catalan, Spanish and English.
Teaching guide — Session 1
The main course is online and self-directed. This guide supports an optional group version of the first practical session. Follow the same six learner steps and retain the checks even when shortening explanations.
1. Outcome and preparation
Goal: a logging app using fictional data, connected to a Sheets tab, deployed with restricted access and updated at the same /exec.
Estimated duration: 150 minutes, which can be spread over several meetings. A keyboard-equipped computer is recommended for editing; a phone is useful for testing.
By the end, each learner should be able to:
- Locate dining room/frontend, kitchen/backend and pantry/data in
Index.html,Codi.gsand Sheets. - Identify the spreadsheet by its ID, the
Registrestab and the headers. - Explain why they review permissions and validate input on the server.
- Check valid input, invalid input, persistence and access.
- Deploy a new version in the existing deployment and identify how to restore the previous version.
Before the meeting
- Confirm that the group has authorised accounts and tools. Resolve restrictions with the administrator. Do not lend accounts or share passwords.
- Work through S0 and S1 using fictional data. Test restricted access and the same
/execafter updating. - Prepare a spreadsheet with a
Registrestab,DataandHoresheaders and no other data. Distinguish document name, tab name and document ID. - Have the reference example and both files ready. Do not promise identical AI-generated code or that it will work on the first attempt.
- Review permissions and deployment options in the demonstration account. Labels vary by language and Google configuration.
- Rehearse a wrong-tab-name error in a copy. Show how its message helps fix the issue; do not provoke errors with real data.
2. Practical route
| Step | Time | Activity | Ready to continue when |
|---|---|---|---|
| 0 · Goal | 10 min | Choose one input and result; locate the parts | The learner can describe what they expect |
| 1 · Spreadsheet | 20 min | Create or reuse S0's blank document; Registres, headers and ID | Tab, row 1 and ID are located |
| 2 · Code | 20 min | Generate and understand both files | Explicit connection, validation and visible errors |
| 3 · Connection | 30 min | Paste files, set ID, review permissions, run comprovaConnexio | Connection check succeeds without writing data |
| 4 · Deployment and tests | 40 min | Restricted access; valid, invalid, persistence, access and phone cases | Tests produce expected results |
| 5 · Update | 30 min | Backup, small change, new version and repeated tests | Same /exec, visible change and preserved data |
These timings are a guide. Extend or divide the session to allow a break; do not cut tests to fit in a second app.
3. Supporting each step
Goal and restaurant
Start with a small action: record and retrieve a value. Give a brief demonstration of the Sleep diary or another prepared app. Ask where the dining room, kitchen and data are. Explain that AI helps write the code; this app does not query AI each time it saves a row.
Appearance is optional. If learners spend too long choosing colours, return to the outcome: save, retrieve and check.
Spreadsheet and ID
The manual route is the foundation and does not depend on a chat integration with Drive. If export to Sheets is offered, it can be used after checking the result.
Show three separate things:
- The document name at the top and its ID after
/spreadsheets/d/. - The
Registrestab. - The expected headers in row 1, in the correct order.
Script ID and Deployment ID identify other parts. Knowing a document ID does not grant access. Code names and headers also stay unchanged when switching the course language.
Code and connection
Learners obtain complete Codi.gs and Index.html files. The initial code file may be called Code.gs: reuse or rename it without duplicating functions. Index must match createHtmlOutputFromFile('Index').
The backend uses SpreadsheetApp.openById(ID_DEL_FULL) and looks up the named tab. It must not rely on an active spreadsheet. comprovaConnexio() validates configuration and headers without writing rows.
Explain Sheets permission scope accurately: it may cover the account's spreadsheets even though the app uses a specific document. If email, Drive or other unnecessary services are requested, review the code before proceeding.
A Google warning does not demonstrate safety. If the project or scope is not understood, pause and support the learner. Do not turn “Advanced → Allow” into a general instruction.
Deployment and tests
Deployment does not mean public access. The first deployment runs as the learner's account and restricts access to them, or an equivalent restricted option. If this is unavailable or blocked, consult the account administrator.
- Valid input: confirmation and a spreadsheet row.
- Invalid input: a warning and no new row. Browser validation helps, but server validation is necessary too; it can be tested directly using the example tests or a controlled test function.
- Persistence: reload
/execand retrieve the record. - Access: a profile without the authorised account cannot see private app data.
- Phone: the form is readable and usable with the authorised account.
The initial registration form only saves data. Email, third-party data and public access require a review of permissions, server reads, usage limits and service management.
Update
Choose a small recognisable change, such as button text. Have learners save a copy before applying it. They provide the current code to the chat; do not assume AI has modified Apps Script.
Under Manage deployments, select the deployment for the tested URL, edit it and choose New version. Reload the same /exec, check the change and repeat tests. Show where to select the previous version if recovery is needed.
Suggested enhancements are options for continuing, not requirements for the first exercise.
4. Common obstacles
| Situation | What to check |
|---|---|
| Cannot access Apps Script or deploy | Account, message and policy; consult the administrator |
| Spreadsheet not found | Document ID and permissions of the backend's execution account |
| Registres not found | Tab name, not document name |
| Wrong headers | Row 1, order and accents; do not overwrite data to fix it |
| Blank page | doGet, Index and complete frontend |
| Button stays disabled after failure | withFailureHandler, visible message and re-enabling |
| Update is invisible | Same project, existing deployment, new version and reload |
| Response is cut off | Request the missing file in full |
5. Alternatives that keep the learning moving
If internet access or an authorised account is missing, use S1's preview and read the reference example. Record what still needs testing in Google; do not mark deployment as verified.
If code fails, use the error as evidence in the debugging prompt. Compare configuration and error handling with the example. Do not perform every click for the learner: help them identify and verify the change.
6. Closing
Ask each learner to explain a record's journey, show one test and identify one limitation. Completion means a checked version, not an attractive screenshot.
Progress is saved in the browser. Recommend a file backup before clearing browser data or changing devices. S2, currently in Catalan, develops debugging and improvements; a second app is not mandatory homework.
Sources and limits
Bound scripts · Web apps · Authorisation · Communication.
Local tests use simulated services. Run the practice in an authorised account to verify OAuth, deployment and access. A pending check must not be described as completed.
Page generated automatically from recursos/s0-s6/en/guia-professor-sessio1.md · reviewed on 2026-10-26. Edit the .md, not this file.
Download material as Markdown (.md)