Home > database >  How to edit manifest to create test deployment for Google Sheets add-on?
How to edit manifest to create test deployment for Google Sheets add-on?

Time:03-19

Years ago, I created an add-on for Google Sheets that I was able to deploy within my college domain. Specifically, I was able to access it on spreadsheets through the Extensions menu. It recently stopped working, with a message about the developer not having accepted the Marketplace terms of service. I am trying to create a test deployment so I can again use it.

When in the (new) Apps Script editor, I select Deploy > Test Deployments. When I try creating a Google Workspace Add-on, I get this error message:

To test deployment as Add-on, update the manifest file with Add-on details. Learn more about Add-ons.

I am not able to find any helpful information at the linked page about how to update the manifest file. This is the current appsscript.json file:

{
  "timeZone": "America/Los_Angeles",
  "dependencies": {
    "enabledAdvancedServices": [
      {
        "userSymbol": "Drive",
        "serviceId": "drive",
        "version": "v2"
      }
    ]
  },
  "exceptionLogging": "STACKDRIVER",
  "webapp": {
    "executeAs": "USER_DEPLOYING",
    "access": "MYSELF"
  }
}

How am I supposed to update the file so I can make a test deployment?

The project includes 3 files:

  • appsscript.json
  • sidebar.html
  • Code.gs

The code includes onInstall() and onOpen() methods. It uses the Drive v2 API.

I know that the code is all right, because I am able to paste it into the Apps Script editor in spreadsheets and run it from there. I'd rather not have to copy and paste it into sheets.

CodePudding user response:

Manifest for a sheets addon

{
  "timeZone": "America/Los_Angeles",
  "dependencies": {
    "enabledAdvancedServices": [
      {
        "userSymbol": "Drive",
        "serviceId": "drive",
        "version": "v2"
      }
    ]
  },
  "exceptionLogging": "STACKDRIVER",
  "webapp": {
    "executeAs": "USER_DEPLOYING",
    "access": "MYSELF"
  },
  "sheets": {
      "homepageTrigger": {
        "runFunction": "onEditorsHomepage"
      },
      "onFileScopeGrantedTrigger": {
        "runFunction": "onFileScopeGrantedEditors"
      }
    }
}
  • Related