onSelectionChange - new trigger type available soon?

297 views
Skip to first unread message

Kos

unread,
Apr 24, 2020, 5:10:01 PM4/24/20
to Google Apps Script Community
Documentation:
https://developers.google.com/apps-script/guides/triggers#onselectionchangee
The onSelectionChange(e) trigger runs automatically when a user changes the selection in a spreadsheet.

Have someone tested it successfully?

This sample trigger code is not firing (V8):
function onSelectionChange(e)
{
  console
.log(e);
}

Event is also not available from "Add Trigger" dialog yet:

1.png



Alan Wells

unread,
Apr 24, 2020, 6:30:37 PM4/24/20
to Google Apps Script Community
It's a simple trigger, so it will never be available to install.  Meaning that when you open the dialog box to add a new trigger, it's never going to be listed, unless they also make it available as an installable trigger.
I haven't tried it.  Interesting find.

Kos

unread,
Apr 24, 2020, 6:37:04 PM4/24/20
to Google Apps Script Community
Yeah, that's what I thought.

Scott Marquardt

unread,
Apr 27, 2020, 4:56:04 PM4/27/20
to Google Apps Script Community
Yeah, I can't get it to work either. 

Sure will be handy once it's as operable in the field as it is in the documentation.  ;-)

- S

Kos

unread,
Apr 29, 2020, 8:18:46 AM4/29/20
to Google Apps Script Community
As per https://stackoverflow.com/a/61409149/555121:
onSelectionChange is a recently rolled out feature.

Hopefully someone can confirm it's working for their script soon.

scott.m...@menta.com

unread,
Jun 29, 2020, 3:33:49 PM6/29/20
to Google Apps Script Community
I trust everyone is already playing with this, since it's working now?

- S

Alan Wells

unread,
Jun 29, 2020, 3:52:39 PM6/29/20
to Google Apps Script Community
Everybody whose anybody.
Anybody whose not nobody.
Anyone whose in it for the fun.
And even those who just, want to "get it done."

Kos

unread,
Jun 30, 2020, 5:49:12 AM6/30/20
to Google Apps Script Community
Don't forget currently onSelectionChange is a simple trigger:  https://stackoverflow.com/questions/62647068/onselectionchange-google-app-script-doesnt-work-at-all  
So it don't work with functions that need authorization :(

Scott Marquardt

unread,
Jun 30, 2020, 2:21:16 PM6/30/20
to google-apps-sc...@googlegroups.com
Yeah, that's sad for one particular application I had in mind. We have a sidebar whose content needs to vary depending on the active column. It would be nice to have it just automagically change -- but unfortunately a sidebar display needs authorization.    :-(      So I literally have to have a "refresh" button on the sidebar itself, that the user clicks after changing columns. That's truly a "so close -- and yet so far" frustration. 

Argh. 

- S

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/9de1e469-8d1d-41e8-9b29-0988880dc5d5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages