John
John

Reputation: 21

Version control for Google Apps Script GUI Builder UI

I have published a Google Apps Script as a web app (Let's say it's Version 1 in 'Manage Versions'), I am now working on code for a new version. The issue I have is any changes to the GUI Builder UI for the new version are immediately applied to the published web app version, which naturally causes a lot of problems for current active users as they have Version 1 code (good) mixed with yet-to-be-published GUI Builder components (not good). How do I get GUI Builder to align with the Google Apps Script version control? Thanks, John

Upvotes: 0

Views: 286

Answers (1)

pbhd
pbhd

Reputation: 4467

Hmm, I think there is something missing in the gas version-managment regarding the things built with gui-builder, maybe you should file an issue for that (google-apps-script-issues), seems to be not yet reported.

As a workaround 1 (as there seems to be no way to copy a gui inside the gui-builder), you could just make a copy of the project when you are ready to publish a new version and just publish the copy to your users (drawback: key changes, so you have to update your users with a new link to the app)

Workaround 2 could be to copy your guis into a separate library and have as code a single function like

function getComponent (app, guiName) {
  return app.loadComponent(guiName);
}

which you then use from your project to load the gui. This means each time you want to create a new release, you copy your project, replace all the source-code in this copy with the above function and reference that copy as library from your project. This library then has to reference the original project as library too and you have to update the event-handlers inside the gui builder to point to that original handlers in your project. Made a short test and it seems to work, but what a mess...

Upvotes: 1

Related Questions