Questions
Frequently asked questions.
- Why doesn't Google Apps Script autocomplete my variables?
- The native editor at script.google.com knows top-level service names such as SpreadsheetApp and GmailApp, but it often loses track of a value once you store it in a local variable, pass it to a helper function, or receive it as a trigger parameter. Installing myFunction (Error Checker for Google Apps Script) adds a TypeScript language service to script.google.com that tracks variable types as you edit.
- Why doesn't autocomplete work on sheet or range inside my function?
- A plain JavaScript function such as function highlightRow(sheet, range) gives the editor no type information for its parameters, so sheet and range default to untyped values. Add JSDoc @param comments such as @param {SpreadsheetApp.Sheet} sheet and @param {SpreadsheetApp.Range} range, or let myFunction infer those JSDoc types from how the function is called across your project (TS7006).
- How do I get autocomplete for e in onEdit(e) or onFormSubmit(e)?
- Add a JSDoc comment above the trigger function with the matching event type: /** @param {Events.SheetsOnEdit} e */ for onEdit(e), /** @param {Events.SheetsOnFormSubmit} e */ for a spreadsheet-bound form submit trigger, or /** @param {Events.FormsOnFormSubmit} e */ for a Form-bound script. With myFunction installed in Chrome, typing e. then lists the properties on that event object.
- How do I know what properties e has in a Google Apps Script trigger?
- The properties on e depend on which trigger fired. A Sheets edit trigger (Events.SheetsOnEdit) provides e.range, e.value, e.oldValue, and e.source. A Sheets form-submit trigger (Events.SheetsOnFormSubmit) provides e.range, e.values, and e.namedValues. A Form-bound submit trigger (Events.FormsOnFormSubmit) provides e.response and e.source. A web-app doPost(e) handler (Events.DoPost) provides e.postData, e.parameter, and e.parameters.
- Do I need VS Code or clasp to get variable autocomplete in Apps Script?
- No. myFunction (Error Checker for Google Apps Script) runs inside Chrome on script.google.com, giving you typed variable completions, cross-file navigation, and rule-based JSDoc inference for free without an account and without installing VS Code, Node.js, or clasp.