Home > database >  Google Sheets addon script cannot display both homepage addon card and addon menu
Google Sheets addon script cannot display both homepage addon card and addon menu

Time:11-15

I have created a Google Sheets addon. I have used createAddonMenu in the onOpen function to create a set of addon menus. I have also configured appscript.json to set a homepageTrigger that displays an addon card.

When operating in a test environment, the homepageTrigger works properly and the add-on card is displayed. The add-on menus are not displayed.

When deployed to the marketplace, the opposite occurs - the addon card is never displayed, but the addon menus are displayed correctly.

I was expecting both the addon menus to display and the homepage card to display.

I should add that I am using the new runtime.

CodePudding user response:

It's not possible to use the Class Ui and CardService in a single add-on. Also it's not possible to use triggers like onOpen with triggers like homepageTrigger.


Google Apps Script could be used to create two types of add-ons, each type works in different contexts:

  • Workspace add-ons. These add-ons works with CardService and triggers like hompageTrigger but not with Class Ui and triggers like onOpen. These add-ons also could be created using other runtimes.
  • Editor add-ons. These add-ons works works with Class Ui and triggers like onOpen but not with CardService and triggers like homepageTrigger. These add-ons can only be created using Google Apps Script.

Reference

  • Related