Is there branching functionality on a Google Apps Script Project? - google-apps-script

I am new to Google Apps Script projects, and have a Google Calendar add-on that I have been working on. My users recently came across some bugs, and I realized that I had no idea how to go back to the version they were on, and save the current updates I was working on at the same time, like a github branch.
I did some research and couldn't find anything out online, so just want to know if there are any other alternatives other than pulling down all code locally and uploading it to my personal GitHub.

To make your add-on go back to a previous version, just go to the Google Workspace Marketplace SDK and set the version number that you want to make available for your add-on users.
The Google Apps Script web editor it will always be showing the head deployment. You might use Google Apps Script API / CLASP to get access to any version. If you want to use the web editor, you should overwrite the files of with the version that you want to use.

Related

How to automatically load a google apps script menu on all user accounts?

I've searched around for this, but haven't found any info. I've written a few scripts that are bound to certain google docs/sheets. Instead of being bound to a particular doc/sheet, is it possible to have a google action script that loads whenever anyone in my google user account group opens a new or existing doc/sheet?
I know how to load a menu UI. That's simple. I know how to create a stand-alone script. I'm asking for something different. Basically, I want to create a deployment suite of proprietary scripts for our company, and whenever a current or future user of our group opens any new or current Google docs/sheets, the menu appears in their UI.
Is this possible, or do I have to ask my users to "install" my suite every time?
If this exists in GAS, I don't know where to look.
Since you mentioned that you want to have the script available as a "button" that can be accessible by any user from any Sheet or Doc I think the only way to do this is by deploying your script as an add-on then make it available internally through the Google Workspace Marketplace and do a domain installation of this add-on so it gets installed for all your users automatically.
First you would need to create the script and deploy it as an add-on. You can skip the part of the OAuth verification process because you are not publishing a public add-on but just an internal add-on for your organization.
After that make sure to add the Google Workspace Marketplace SDK to your Google Cloud Platform project. In the App configuration section from the Marketplace SDK set everything as internal/private and mark the Google services where you want it to be available and create the store listing.
Once you finish that you will see the app has been approved and an installation link. Make sure to install it domain wide and wait a couple of minutes for it to appear in all your files (from the selected Google services during the configuration) for all your users.
The result should look something like this:
References:
Create and manage deployments
Publish an app

Using external Web IDE in Google Appscript

I am creating an app for my company.
The thing is, I work on a governmental company and have several restrictions. I can use the google services including apps scripts and cloud services (the free services only) but ideally I can't install any IDE locally so I a web IDE would be the ideal solution.
But I am having a hard time to understand how can I export/import my scripts, I mean, I can't even find them on drive (I can find my project and that's it).
Some web based IDE's can be authorized, and some other will be blocked, this one: https://shiftedit.net/ seems to work.
I am just not understanding it?
Google Apps Script project files (.gs and .html) are not files that can be found in the Google Drive user interface. To export / download these files you could use Google Apps Script API, CLASP, Google Apps Script GitHub Assistant Chrome extension.
P.S. I just found https://github.com/dev-container/gas but have not tried yet... it' for working on Google Apps Script projects with VS Code and GitPod containers.
Related
How best to develop Google Sheets scripts and Git versioning
Is it possible to upload a .gs file to an apps script project of a copied google doc?

Publish an add-on from Standalone Google Apps script

I have developed a google sheet addon, I had succefully published that add-on from Google sheet bound script ie from tools->Script editor.
But If I made direct google apps script project(standalone project),I am unable to publish it,And a notification is popped up.
I research that I need it to setup it from google console,to publish standalone google app script to add-on ,But I don't found exact options to proceed.
The instruction is a very confusing for a first timer. Google keeps redirecting you to the page describing publishing editor addons, but what you really need is the page describing how to create a project on cloud platform.
https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project
Steps:
Create Project and get Project Number using instructions from link above
Go to you script. Select in the menu Resources > Cloud Platform projects... and enter your project number there
Then google will ask you to setup OAuth
After that, you can move your script to cloud platform and publish.
To publish an addon for G Suite Document editors follow the instructions here
https://developers.google.com/gsuite/add-ons/how-tos/publishing-editor-addons
The specific part about the GCP project is
Technical
The add-on script project must use a standard Cloud Platform (GCP) project. If the script project currently uses a default GCP project, you must switch to a standard GCP project. All collaborators working on the add-on should have access to the standard GCP project.

Google Apps Script published add-on stopped working post chnages

I have a published Add-on in web store for Google Docs. I have also been able to make changes to it and re-publish to web store couple of times in past.
But when I made a recent change to add-on, it won't allow me to test as Add-on again. Only error I am getting is:
"There was a problem testing the script as an add-on. Please try again later."
I see in Google's Issue tracker that such problems have been reported but for Add-on for Google Sheet where Sheet being tested was deleted was causing the issue.
https://issuetracker.google.com/issues/36763685
I have used different Apps script projects to test the code before copying it to published Add-on. Now I am not able to get Select Document screen either.
Same Apps-script project if copied and run as Add-on, it works fine, but not published version. Since this is already a web store published add-on, I need to make this version work.
Any pointers will be of great help. Thanks!

Deploying my custom Google Sheet

I have been searching for an answer, more that likely using the wrong terminology, to my question and I have read through the Google documentation but I am now more confused than when I started looking for the answer.
I'm new to Google Apps and a complete beginner at Javascript. I recently started working in a Google Apps school (we have our own domain) and I have started developing some custom Google Sheets to aid other teachers and boost productivity.
I have developed a Sheet with some custom scripts and a custom menu bar to call the various functions of the script. Since I am so new to Javascript my scripts have some bugs that I fix as other users report them to me. However, my problem is that when I fix a bug in my "master" Sheet the end user must open the shared master Sheet and make a copy of it to benefit from the update. I want to update to be pushed out to all copies of the sheet (circa 4 copies)
I know need to deploy it but I don't know whether I need to deploy it as a web app or a sheets add-on from the script editor? Again, we have our own domain so I do believe I don't need to have it approved by Google to use it internally in our domain?
Based from this documentation, public add-ons require a review before publication, since you have your own domain, you can publish just for users within your domain without a review.
To publish an add-on for the first time, follow these steps. If you also want to let Google Apps domain administrators install and authorize your add-on for all users in their domain, follow the steps for domain-wide publication as well.
When you fixed your bugs and wanted it to be updated to all copies of sheets, you can follow this Update your add-on link to update an add-on that you have already published.
Open the add-on project in the script editor.
Make the necessary changes to your code, then save a new version of your project by clicking File > Manage versions, then Save
New Version. Close the Manage Versions dialog.
Click Publish > Deploy as add-on. (Or Sheets or Docs or Forms add-on.)
In the dialog that appears, change the add-on's details as needed, select the new version of your script, then click Update store
item. (If you change the add-on's name, make sure you also change
the name of the Apps Script project to match, as the project name is
shown in the authorization dialog.)
In the store listing, click Publish changes, then click OK in the dialog that appears.
Hope this helps!