googleworkspace / googleworkspace/apps-script-samples
onSelectionChange(e)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.2k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
I've been trying to use onSelectionChange(e) however it yields the error TypeError: Cannot read property 'range' of undefined. To clarify, I did not make any changes to the code, I just copied and pasted it from https://developers.google.com/apps-script/guides/triggers and into the editor. Also, I tried the following triggers and they worked:
-
onEdit(e)
-
onOpen(e)
So I'm not sure what's going on, any help would be much appreciated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the onSelectionChange(e) example in the linked Google Apps Script triggers guide and compare it with the working onEdit(e) and onOpen(e) examples. Reproduce the reported TypeError in the Apps Script editor and determine why e.range is undefined; done when the copied example runs correctly or the guide's usage requirements are clarified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100