0

I've an question about libraries usage within Google Sheets. I developed a standalone Apps Script published as Library. This library is used by 150 Google Sheets files (I did that to centralize and hide some code from users).

Today, I need to update the library code to add some functionalities. I'd like to know if you know a solution to remotely update the 150 Sheets Clients to match the new Library version on client side (I don't use the "dev" mode).

It seems that the Apps Script API can change do changes on the library itself but not on the client side (sheets).

Has someone else had this issue and how did you deal with it ?

Cooper
  • 59,616
  • 6
  • 23
  • 54

1 Answers1

2

Nope. You'll have to do it yourself. Libraries not in dev mode never auto-update, and can't be updated to the latest version by the library developer, because they are libraries -- it is expected that there is code in the destination that uses it, and thus it is not guaranteed that changing the version does not break the interface code.

If you want your deployed code to be auto-updated to the latest version, you should be using the add-on model, or (when you know that you will have backwards compatibility for your library interface) accessing your libraries from your scripts in dev mode.

You can collect the requisite Script IDs (File -> Project Properties) that need to have the library updated, and you can update the Script Project contents (including the appsscript.json manifest file that specifies the library version) via the Apps Script API. You may find clasp helpful for this.

tehhowch
  • 9,645
  • 4
  • 24
  • 42