Correct format for Google Forms workspace add on appscript.json manifest file

37 views Asked by At

I am unable to find the correct way to structure manifest file for a Google Forms add-on.

{
  "timeZone": "America/New_York",
  "dependencies": {
  },
  "form": {
    "name": "My Forms Add-on",
    "logoUrl": "https://www.example.com/hosted/images/2x/my-icon.png",
    "primaryColor": "#4285F4",
    "secondaryColor": "#00BCD4",
    "authorizationCheckFunction": "get3PAuthorizationUrls",
    "contextualTriggers": [{
      "unconditional": {},
      "onTriggerFunction": "buildAddOn"
    }]
  },
  "exceptionLogging": "STACKDRIVER"
}

This result in the following error: Invalid manifest: unknown fields: [form]

The documentation does not provide an example for forms: https://developers.google.com/apps-script/manifest/addons

2

There are 2 answers

0
TheMaster On

Forms doesn't seem to be supported. The docs state:

Note: Google Workspace Add-ons only extend Gmail, Calendar, Drive, Docs, Sheets, and Slides.

0
Scott Paterson On

Okay I figured it out for anyone else that comes across this problem:

For Google forms, if you're trying to deploy it / for testing, you have to do it as a editor add-on. Not as a Google workspace add on.

Even though you are making add-on for the Google workspace store, it isn't actually a "Google workspace add-on" in the deployment menu. It's actually just an editor add on.

{
  "timeZone": "America/Los_Angeles",
  "dependencies": {},
  "exceptionLogging": "CLOUD",
  "oauthScopes": [
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/forms.currentonly"
  ],
  "runtimeVersion": "V8",
  "addOns": {
    "common": {
      "name": "Test",
      "logoUrl": "https://asdf.png",
      "layoutProperties": {
        "primaryColor": "#e34f43",
        "secondaryColor": "#423e3e"
      }
    }
  },
  "urlFetchWhitelist": [
    "https://asdf/*"
  ]
}