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:

Before the meeting

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:

  1. The document name at the top and its ID after /spreadsheets/d/.
  2. The Registres tab.
  3. 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.

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)