Testing my Sheets Workspace Add-on will Install but will not "run" onOpen in a new test sheet

70 views Asked by At

Here is my expected and actual breakdown, based on my reading of the various Google Developer documentation for building a Google Sheets Editor and Workspace Add-on

Expected outcome: After navigating to Deploy -> Test Deployments -> Workspace Add-ons and clicking Install, then upon clicking done, I open a new spreadsheet ("sheet.new") and upon opening the document and waiting a few seconds, I expect that my Add-on's custom menu item will display in the Extensions drop down menu

The Test deployment section for deploying a "test Workspace Add-on" enter image description here

Actual outcome: After navigating to Deploy -> Test Deployments -> Workspace Add-ons and clicking Install, then upon clicking done, I open a new spreadsheet ("sheet.new") and upon opening and waiting a few seconds, there is no custom menu item displaying in the Extensions drop down menu (or in any other menu of course). And there is no reference to any other onOpen(e) event for this new sheet in my Cloud Logs.

For context, this Google Sheets add-on is fairly simple - it has two custom functions that make external API requests, and an HTML "settings" sidebar where users can quickly reference some links and admin read-only fields.

Edit: and confirming that the Add-on does work as expected in the Test Deployment modes for Enabled, Installed & Enabled authModes, it's just in the last mile of testing where I am trying to get the host-application (Sheets in this case) to be extended that I am encountering this issue.

I have read just about every other related stackoverflow post, but none of the answers are either relevant or address my extension's use-case.

I am not sure if there's something missing from appsscript.json/manifest file, or there's something silently blocking the installation, here's my current 'anonymized' manifest file:

{
  "addOns": {
    "common": {
      "name": "My sheets app",
      "logoUrl": "https://lh3.googleusercontent.com/__PIC_ID__",
      "layoutProperties": {
        "primaryColor": "#B8136C"
      }
    },
    "sheets": {
      "homepageTrigger": {
        "runFunction": "onOpen"
      }
    }
  },
  "timeZone": "America/New_York",
  "dependencies": {
    "enabledAdvancedServices": [
      {
        "userSymbol": "Sheets",
        "serviceId": "sheets",
        "version": "v4"
      }
    ]
  },
  "exceptionLogging": "STACKDRIVER",
  "oauthScopes": [
    "https://www.googleapis.com/auth/script.container.ui",
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/userinfo.profile",
    "openid",
    "https://www.googleapis.com/auth/drive.file",
    "https://www.googleapis.com/auth/spreadsheets.currentonly",
    "https://www.googleapis.com/auth/script.external_request"
  ],
  "runtimeVersion": "V8",
  "urlFetchWhitelist": [
    "https://www.mysamplesite.net/"
  ],
  "webapp": {
    "executeAs": "USER_ACCESSING",
    "access": "ANYONE"
  }
}

Is there anything immediately obviously wrong with the appsscript.json properties, or any other other troubleshooting steps I should take?

EDIT: I also for fun tried several permutations of editing, including changing the appsscript.json homepageTrigger properties to this:

"sheets": {
      "homepageTrigger": {
        "runFunction": "addMenu"
      }

The addMenu function is a function in my code.gs file that adds a custom menu item to the Extensions menu. After saving my changes, uninstalling (clicking Done) and reinstalling (clicking Done) this did not seem to have the expected (and desired) impact I was looking for.

EDIT 2: Uploading this test of the View document add-ons approach that @AlejandroTalamet suggested enter image description here

0

There are 0 answers