Home > OS >  Apps Script layoutProperty manifest field support for Gmail add-on
Apps Script layoutProperty manifest field support for Gmail add-on

Time:02-21

Based on this documentation, there is a common layoutProperties field available to the manifest.

I can define primary and secondary colors using it.

However if I add it to my Gmail add-on manifest, like this:

{
  "dependencies": {},
  "gmail": {
    "name": "My Add-on",
    "layoutProperties": {
      "primaryColor": "#367c1a",
      "secondaryColor": "#367c1a"
    }
}

I get this error when saving the manifest:

"appsscript.json" has errors: Invalid manifest: unknown fields: [gmail.layoutProperties]

Am I doing something wrong? According to the documentation it's a common field and if I understand correctly, it should also apply to Gmail add-ons.

Btw I also tried putting it outside gmail data, with the same error when saving.

Thanks in advance.

CodePudding user response:

As you pointed out, the layoutProperties field is part of the Common object, not the Gmail one

So your manifest needs to look like this:

{
  "dependencies": {},
    "addOns": {
      "common": {
        ...,
        "layoutProperties": {
          "primaryColor": "#367c1a",
            "secondaryColor": "#367c1a"
        }
      },
        "gmail": {
          ...
        }
    }
}
  • Related