googleworkspace / googleworkspace/apps-script-samples

onSelectionChange(e)

Open
#150 1 comment 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.