DiscoveryVIP / Apps Script AcademyHelp

Help Center — Google Apps Script Discovery Academy

Getting started: your first three minutes

Choose Write Your First Apps Script. Find Alex in row 2 and Status in column B. Locate getRange("B2").setValue("Complete") in Source · Code.gs. Click Run Script. B2 changes to Complete and is highlighted. Console can be empty because a write does not automatically log text. Click Step Through to inspect calls. Change B2 to B3 and click Run on fresh sample: Jordan changes instead. Explain the result, then Save Script.

What Apps Script teaches

Real Google Apps Script runs JavaScript on Google servers with Workspace service APIs. This course teaches programming, spreadsheets, documents, Drive, drafts, Forms, Calendar, Slides, triggers, interfaces, HTTP, AI validation, reliability and deployment review. Local adapters perform actual fictional state changes; they do not authenticate to Google.

Selecting lessons and learning modes

Open Learn. Expand a module, use Search lessons or Jump to lesson. All 100 lessons are selectable. Absolute Beginner expands explanations; Guided Builder starts new work with an exercise; Independent Developer retains complete editing. Switching mode preserves current drafts. Previous and Next lesson navigate the path. Opening a lesson does not count as mastery.

Finished code versus your exercise

Show Finished Code displays the complete reference separately and does not change Source. Load Repair Exercise replaces Source after confirmation; repair it yourself or compare with the reference. In Projects, Load Finished Project explicitly loads the finished source. Export Project downloads the current editor files, so load the finished project first if that is what you want. The Downloads folder also contains all 40 complete projects.

Four source examples

Prepared example 1 is the working operation. Example 2 is an intentional fault to diagnose. Example 3 runs the operation twice so you can investigate duplicate or idempotent behavior. Example 4 adds an optional diagnostic boundary with start/completion/error evidence. These are four authored example slots per lesson, not four independent applications. Select one and click Load Example; read its expected output before running. Earlier beginners can focus on example 1 before the optional professional patterns.

Source, console, timeline and snapshots

Source is editable Code.gs-style JavaScript. Console displays actual captured messages and errors. Operation timeline records local service methods, details and elapsed local timing. Step Through and Next operation replay these records after a run; they do not pause arbitrary code. Supported variable snapshots instrument statements and are bounded. An empty console can accompany a successful state change. Local timing is not Google latency.

Editing and resetting sample data

Click a spreadsheet cell to edit it. Choose a tab through Sheet. Workspace data & failure scenarios contains the complete fictional JSON; Apply edited data validates and applies it. Restore sample data asks before replacing state. Run Script uses visible current state; Run on fresh sample restores initial data first. Undo Simulation swaps the last before/after state. Authored checks use the original sample rather than custom inputs.

Sheets workspace

Choose Sheets Automation Lab in Playground. Edit cells, run the script and inspect changed cells, formatting records or validation rules. A1 addresses and numeric coordinates start at one; nested arrays use zero-based indices. setValues requires an exact rectangular matrix. The local formula subset is SUM, AVERAGE and COUNT on a rectangular range; unsupported formulas display an explicit marker.

Docs workspace

Choose Docs Generation Studio and select Docs in Preview. Run the template-copy script. The preview shows document paragraphs and tables; the original template stays intact. The simulator provides one tab per document. Real Google documents may have nested tabs, so exported examples explicitly choose the first tab and require adaptation for other tabs. replaceText uses regex patterns; the local JavaScript regex subset differs from Google RE2.

Drive workspace

Choose Drive Management Lab and Preview → Drive. Inspect fictional IDs, folder parents, files and sharing state. Run the copy/rename example and compare source and output IDs. Undo Simulation restores local changes. Names may be duplicated. The adapter does not emulate inherited ACLs or shared-drive roles; review Advanced Drive service requirements for production shared-drive work.

Gmail workspace

Choose Gmail Communication Studio, run and select Gmail drafts in Preview. Review recipients, subject, plain text and HTML source. Drafts are not sent. The local inbox supports subject substrings and one label: query, not the full Gmail search language. Real Gmail access and draft creation require authorization. Use your own authorized test recipients when transferring code.

Forms and Calendar workspace

Choose Forms & Calendar Lab, run and inspect Forms. Type fictional responses and click Submit sample response; it updates the local response table without firing real triggers. For calendar examples open lessons 51–55 and choose Calendar preview. Compare explicit UTC timestamps and interval ordering. The local calendar does not send invitations or implement every recurrence/time-zone feature.

Slides workspace

Choose Slides Generation Studio, run and inspect Slides. Each row maps to a distinct slide. The preview displays text, shapes and coordinates structurally, not with Google layout fidelity. Positions in Google are points. Images and advanced formatting outside the adapter subset must be tested in the real environment.

Triggers and event objects

Choose Prepared event before running a trigger lesson. Manual supplies no event. Spreadsheet edit gives range/value; spreadsheet form submission gives values/namedValues; a Form-bound event uses a different response contract. The form-bound sample here is a shape illustration, not a complete FormResponse adapter event. Installing a trigger locally records configuration but schedules nothing. Programmatic writes do not fire onEdit. In Google, installable triggers run as their creator and simple triggers have restrictions.

Workflow builder

Open Automation. Load Template after confirming replacement. Select a node in the diagram or Node picker. Edit Node ID, Type, Configuration value, Next, Otherwise and Error. Apply Node stores your edit; Validate Graph checks connections, reachability and cycles. Compile to Source produces runnable Apps Script. Run Script executes the source; source edits do not automatically change the graph. Read produces row arrays; Filter uses column B; API/Gemini produce a packet; Parse consumes JSON text. Set workflow-approved=yes in fictional properties only after review to test an approval path. Graphs are bounded directed acyclic workflows, not a full arbitrary-loop engine.

Web Application Studio

Choose Web Application Studio or open a project with Index.html. Source contains server functions; Client contains HTML/CSS/JavaScript. Click Run Web App Preview, then use Load records or the form in the iframe. The request inspector records actual local asynchronous bridge calls. Set Response delay or Inject server failure to investigate callbacks. Trailing-underscore functions are private. Local server calls are serialized; response delays illustrate asynchronous UI handling. This is not a live Google deployment.

Gemini and structured JSON

Choose Gemini & Intelligent Automation Lab. Edit Proposed feedback result and click Validate Structured Output. Allowed categories are support, praise and bug; summary must be a nonempty string up to 200 characters. Parsing and schema validation do not establish factual correctness. Download Server-Side Gemini Adapter provides optional real Apps Script source with configured model/key, input limits and an attempt cap. No key is requested by the site, and no live model call was tested. Check current provider pricing and model availability before running.

Testing and debugging

Check My Work runs fresh sample inputs and compares the actual observable contract. Equivalent implementations may pass. Custom tests call a named function with JSON arguments and compare its return value or an expected error. A function that logs but does not return has undefined output. Testing state, side effects and invalid cases remains necessary. Practice & debugging contains coding, investigation and knowledge-check activities. Explanations are recorded for review rather than automatically declared correct.

Saving, experiments and backups

Save Script and Save explanation and notes write this academy’s IndexedDB records. Browser data is not cloud-synced and may be cleared. Saved experiments can be named, duplicated, renamed, loaded and deleted. Export JSON Backup from My Progress creates a version-1 portable backup. Import asks before replacing data and clears imported check evidence until rerun. Source ZIPs contain runnable files; backups contain learning state.

AI Prompt Studio

Expand AI Learning Prompt Studio, choose a goal and Build Contextual Prompt. It includes the actual source, current output, expected behavior and prediction. Edit the text and Copy Prompt for use in an external assistant. Do not include private data or secrets. Verify returned methods against official references, run the proposed tests and inspect real results. The academy itself calls no AI service.

Accessibility and keyboard use

Tab and Shift+Tab move between controls; Enter/Space activate buttons. Ctrl/Command+Enter runs code. Tab leaves the source editor rather than trapping focus. Code font size is adjustable. Workflow actions have button/picker alternatives to dragging. Changed cells use text/value differences as well as highlighting. Reduced-motion preferences are respected. Physical screen-reader and keyboard behavior still require browser verification.

Presenter and educator resources

Open Teaching & presenter scripts. Choose one of 25 prepared demonstrations. Presenter links load the related lesson in a large presentation view. Narration and actions are printable. Each educator plan follows Discover → Predict → Understand → Experiment → Build → Test → Explain → Reflect → Extend. Demo durations are rehearsal estimates, not produced videos. Explain the local-versus-Google boundary in every session.

Privacy and execution boundaries

Use fictional information. Code executes in a disposable worker inside an opaque sandbox iframe with network blocked by policy and a three-second timeout. Loops and functions use operation guards. Console and snapshot outputs are bounded. Client previews are separate opaque iframes. These are teaching safeguards rather than a claim that hostile code cannot exhaust a browser engine. No analytics or API credentials are added by this academy.

Transfer your source to real Google Apps Script

The diagrams below describe the workflow; they are not screenshots of Google’s interface. Interface labels may vary by account and rollout.

Google Sheets→Extensions→Apps Script→Code.gs→Save / function / Run→Execution log / verify sheet
  1. Create a fresh sample spreadsheet and add Name / Status plus Alex, Jordan and Morgan with Pending values.
  2. Choose Extensions → Apps Script. Code.gs contains server-side source, not browser JavaScript.
  3. Paste the first lesson’s complete source. Save, select main in the function picker and click Run.
  4. If authorization is requested, inspect the code, account, target files and scopes before approving. Organization administrators may restrict access.
  5. Review execution logs and return to the spreadsheet to confirm B2 changed. Log messages alone do not prove the right cell changed.
  6. Reopen the same script through Extensions → Apps Script later.
  7. For exported projects, follow SETUP.md: add Code.gs, Setup.gs, applicable Index.html and the manifest. Run setupSample only in a fresh sample workbook; it creates sample resources and stores configured IDs.
  8. For a standalone project, open script.google.com and create a project. Use SpreadsheetApp.openById with a configured authorized workbook ID; an active workbook may not exist.

If Extensions is missing, verify you opened a Google spreadsheet with appropriate edit access rather than a preview or converted-file limitation. If access fails, check the signed-in account, file sharing and administrator policy. If a sheet is null, verify its exact tab name. If a function is missing, save valid source and select the correct entry point. Never bypass an ownership or authorization restriction.

Official references: Automation quickstart, authorization, web deployments, current quotas.

Exact button reference
Add Node
Add a uniquely named editable node; connect it before compiling.
All Projects
Return to the searchable project library.
Apply Graph JSON
Parse, validate and apply edited graph JSON; invalid connections are rejected.
Apply Node
Store the selected node fields; validate and compile before running.
Apply edited data
Validate and apply edited fictional JSON to Preview. Invalid shape produces a status error. Undo restores the prior local state.
Back to Activities
Return to the relevant activity catalog.
Back to Questions
Return to the question catalog.
Build Contextual Prompt
Create an editable external-AI prompt containing the current source, outputs and expected result.
Check Answer
Grade selected choices or record a written explanation for review; feedback appears below.
Check My Work
Run fresh authored inputs and compare actual behavior with the target.
Compile to Source
Validate and generate runnable source from graph.
Copy Code
Copy current source with the browser clipboard API.
Copy Prompt
Copy the edited prompt; no AI request is sent.
Delete Experiment
Ask before deleting the selected local experiment; a backup is required for recovery.
Download Server-Side Gemini Adapter
Download optional live server source; the browser makes no AI request.
Duplicate Experiment
Create a separate named copy with a new ID.
Explore Automation Examples
Open the searchable 40-project library.
Export JSON Backup
Download a version-1 JSON copy of learning state.
Export Project
Download current files, setup and testing documentation; does not deploy.
Follow the Learning Path
Open the most recently selected lesson in the complete path.
Full Screen
Request browser fullscreen; use Escape to leave.
Knowledge checks
Open knowledge questions from the current module.
Load Example
Ask before loading the selected example and sample input.
Load Experiment
Ask before replacing scratch work with the selected saved experiment.
Load Finished Project
Ask before loading complete finished source and fresh input; export downloads those current files.
Load Repair Exercise
Ask before replacing source and sample inputs with the deliberate repair exercise.
Load Starter
Ask before loading incomplete starter source and fresh input.
Load Template
Ask before replacing graph and source with the chosen template.
Next Demo Step
Show the next narration/action step; perform the stated screen action yourself.
Next lesson →
Open the next lesson while retaining the current draft in memory.
Next operation
Advance through recorded service operations and highlight matching source/cell where supported.
Open Learning Object
Open the selected independent learning object with its source and preview.
Open Recommended Lesson
Open the transparently recommended lesson based on recorded checks.
Open Related Lesson
Open the teaching lesson for this learning object.
Open Service Reference
Open the method reference in a separate browser tab.
Open Teaching Lesson
Open the teaching lesson associated with this exercise.
Practice & debugging
Open the challenge, debugging and knowledge-check catalog.
Previous Demo Step
Show the preceding prepared narration/action step without executing code.
Related visual experiment
Open a related editable visual experiment.
Remove Node
Ask before removing a node; repair incoming edges.
Rename Experiment
Change the selected saved name using Experiment name; source is retained.
Reset All Learning Data
Ask before clearing this academy’s local records.
Reset Demo
Ask before clearing only this demo draft and reloading the prepared demonstration.
Reset Example
Ask before replacing source with the prepared reference.
Restore sample data
Ask before restoring initial fictional records. Source remains unchanged.
Run Custom Test
Run the named function and compare return value or expected error.
Run Script
Execute current source against visible fictional state; results appear in Preview, Console and timeline.
Run Web App Preview
Mount an isolated client page and asynchronous local server bridge.
Run on fresh sample
Reset sample input, then execute source. Current simulated changes are replaced.
Save Named Experiment
Save the current source, fictional state and graph under a name; updates an existing selected copy.
Save Script
Persist local drafts, state and learning records.
Save explanation and notes
Save source, explanation, prediction and notes on this device.
Show Finished Code
Reveal complete reference without editing or awarding completion.
Step Through
Select the first recorded actual service operation. Run a service example first.
Stop Execution
Abort execution and close active web preview while retaining source.
Toggle Navigation
Toggle the large presentation view and regular navigation.
Undo Simulation
Swap local before/after state; source is retained.
Validate Graph
Check IDs, edges, reachability and cycles; errors appear in the status area.
Validate Structured Output
Parse and validate edited feedback JSON; show actual validation errors.
Write Your First Apps Script
Open lesson one and focus its source editor.
← Previous
Open the preceding lesson while retaining the current draft in memory.
Field reference

Function accepts a JavaScript function name, for example main. Prepared event chooses a fictional trigger input; Manual has no event. Code font size accepts 12–30 pixels. Simulated service-call budget is a local positive scenario count. HTTP fixture status chooses 200, 429 or 503. Authored API response JSON supplies response text, including intentionally malformed text. Fail this method uses an exact receiver/method such as Range.setValues. Workspace JSON must contain the supported resource collections. Node IDs are unique short identifiers; Next/Otherwise/Error target existing IDs. Configuration depends on node type: People, Pending, People!B2 or alex@example.com. Custom test arguments must be a JSON array; expected return must be JSON. Expected error text instead checks a substring of an actual error. Response delay is clamped to 0–2000 ms. Experiment names are 1–100 characters. Never enter credentials in fields.