Skip to content Skip to sidebar Skip to footer

Google Script: Attach A Script To A Dynamically Added Image In A Spreadsheet

I'm building a Google Spreadsheet-based app in Google Script. One of the things it does is output a selection of items attached to a parent item in rows. I'd like for the user to b

Solution 1:

The argument of assignScript(functionName) is the string value. I think that this is the reason of your issue. So in your script, please modify as follows.

From:

images[images.length - 1].assignScript(editContract);
  • In this case, the script of function is directly put. By this, when the created button is clicked, I think that when the button is clicked, such error message is shown.

To:

images[images.length - 1].assignScript("editContract");
  • Please set the function name as the string value like above.

Reference:

Solution 2:

Responding for posterity: function names in .assignScript need to be encapsulated in quotes. Would have been cool for that to be documented somewhere.

Post a Comment for "Google Script: Attach A Script To A Dynamically Added Image In A Spreadsheet"