1

I'm trying to update a Google Sheets add-on that gets AWS prices (https://github.com/reeve/gs-aws-pricing-helper)

This has a dependency of https://github.com/brucemcpherson/cCacheHandler

I've created a new project on my sheet and added all of the scripts from the AWS Pricing project. Using a function then fails with

Error ReferenceError: "cCacheHandler" is not defined. (line 48).

Any idea how this kind of dependency is installed?

Kos
  • 4,890
  • 9
  • 38
  • 42
Anonymouslemming
  • 518
  • 2
  • 9
  • 16

1 Answers1

4

Dependency with "Library Key" refers to library (note: in new editor this field now called "Script ID").

If you use new or old Apps Script editor, there are instructions for both.

For new editor

To add needed library, open your Google Apps Script project in new editor, find left sidebar (Files, Libraries, Services), and click PLUS icon (Add a library) next to Libraries section.

enter image description here

In opened "Add a library" popup window:

  1. Enter "Script ID" in input field and click "Look up".
  2. Click Add.

Note: in new editor you don't have to select "Version" - by default it's set to latest library version available when you add it.

For classic editor

To add needed library, open your Google Apps Script project in classic editor and select from menu Resources - Libraries...

enter image description here

In opened "Libraries" popup window:

  1. Enter "Library Key" in input field and click "Add".
  2. Select latest library version.
  3. Click Save.

After dependency is added

To check which version of dependency you're currently using in your project, open manifest.json file in Apps Script editor:

{
  "timeZone": "America/New_York",
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "dependencies": {
    "libraries": [
      {
        "userSymbol": "cCacheHandler",
        "version": "19",
        "libraryId": "1U6j9t_3ONTbhTCvhjwANMcEXeHXr4shgzTG0ZrRnDYLcFl3_IH2b2eAY"
      }
    ]
  }
}

You can also edit these values directly, changes to manifest will be applied accordingly.

Kos
  • 4,890
  • 9
  • 38
  • 42