User testing Google Docs addon - google-apps-script

I've written a simple Google Docs addon and prior to publishing it, I would like to allow some friends to test. I managed to do that by sharing the project and having another account create his deployment and test but this is too cumbersome.
I looked around and apparently I needed a project in GCP. I opened a project, edited the OAuth Consent Screen, and assigned my script to that project. I also added test users under OAuth Consent Screen. How do I get those users to install this now and test?
Thanks

"Testing" is a very broad term, and could mean multiple things in this context.
If it's "try it out" then you can publish it privately to your Workspace domain as you don't need to go though the review (reference). Note though that this only works if you have the Workspace domain. This is usually used for internal tools in companies. Other than that, it has the same requirements as publicly publishing it with the exception of being reviewed by Google (see process overview).
If you want them to debug it, you'll have to use the "test deployment", as it has some more tools helping debug errors. You can have a project in a shared drive; this would remove the need to share it manually, but the deployment will have only a single account as its publisher (reference).
References and further reading
Publish an add-on (Apps Script guide)
Test an editor add-on (Apps Script guide)
Create and manage deployments (Apps Script guide)
Update and manage your published add-on (Apps Script guide)
About app review (Google Marketplace guide)

Related

How can I make a Google Docs Add-on for personal use without a Workspace subscription?

I don't want to share it with other users, it's just a personal productivity tool.
It seems my only option is to make it available to external users (internal users is reserved for Workspace accounts), but then I'm forced through the verification process.
I've tried using the "Test Deployment" function in the script editor, but I think that can only be used to test an Add-On that is bound to document. If the Apps Script project is unbound, the test deployment succeeds, but the Add-On doesn't appear in the menu.
I suspect this isn't possible, but I'd appreciate confirmation.

reuse script or publish a private google sheets script add-on without gsuite or being a business

I'd like to reuse a Google Apps Script between multiple sheets on my personal Google account without publishing the script publicaly. One approach that I'm trying to avoid is to simply copy and paste the script between each sheet that I'm using.
After some reading my impression is that this is typically done by publishing an add-on. I am also under the impression that this can (or could) be done privately, so that no code review is needed and you don't need to pay anything. Most of the related questions I've found on SO seem to have out of date answers (chrome web store instead of GSuite Marketplace) or are too simple (share by publishing an add-on) or refer to gsuite users/admin, etc.
Assuming I need to publish an add-on to get easy sharing across all of my sheets I'm told I need to convert my project to a Google Cloud Project. So I created a Google Cloud Project and then went to transfer my code to that project by going to "Resources - Cloud Platform project" and entering my project number. However, when I do that it tells me that I need to enable oauth for the project and it takes me to a page which looks like it will require formal code review.
I am under the impression that private publishing may be possible if I am an organization. So I went back to the Google Cloud Console and tried to create an organization. Here however, it seems like either I need to be subscribing to GSuite or I need to enable Cloud Identity. The latter seems only pertinent to businesses as during the sign up it asks me for my business name and business domain (e.g. jims-business.com); I stopped when it asked me for my domain.
So again, my question is, is it possible to share a Google script between multiple sheets on my personal account without making a public add-on? After way to much time reading through Google terminology my impression is no, but I'd be happy to be proven wrong!
You don't need to be a G Suite user to publish an add-on, but you do if you want to do it as "internal only", as it requires a valid domain.
I'm afraid you will have to copy the same Script for each file and use an onOpen function.

Google App Script Spreadsheet Add-on: Allow people outside of my organization to test it?

I wrote a Google Apps Script that implements spreadsheet add-on functionality. I and everyone in my organization can test it (via Run > Test as add-on). Now I want to allow one specific person outside of my organization to be able to test it as well, without having to publish it.
As far as I understand it from the information I found so far, there are only three permission schemes for scripts: private for me, private for my organization, public for everyone. Is that correct or is there a way to grant access to specific persons?
That person has a Google account, just outside of my organization, and has access to both the App Script and the spreadsheet.
The permission schemes you're mentioning (private for me, private for my organization, public for everyone) it's the Add-on visibility [1], which only applies for published Add-ons. You or any user with at least read permission on the Add-on's script and Spreadsheet can test the Add-on without having to publish it following these steps from the documentation [2]:
1) Open the add-on's script project in the Apps Script editor.
2) Select Publish > Deploy from manifest... to open the Deployments
dialog.
3) In the Latest Version (Head) row, click Install add-on to install
the currently saved version of the add-on in development-mode. If you
install the Latest Version (Head) of the add-on, any changes you make
to the add-on code are applied immediately without you needing to
reinstall it.
4) Alternatively, you can create a versioned deployment and install
that instead. This can be helpful if you want to 'checkpoint' a
version of the add-on to compare it to the version under development.
[1] https://developers.google.com/gsuite/add-ons/how-tos/editor-publish-overview#visibility
[2] https://developers.google.com/gsuite/add-ons/how-tos/testing-gsuite-addons

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.

Custom Functions with add-ons?

I've been trying to create a Google Spreadsheet plugin from some existing Google App Scripts that I have, and one important part of this app script is Custom Functions.
Though the documentation for the add-ons doesn't indicate that this is supported, the documentation for Custom Functions does indicate that you can.
https://developers.google.com/apps-script/guides/sheets/functions
Through testing, I have not once been able to get Custom Functions exposed through a add-on. Does anyone know the secret sauce to get this to work?
Answer
According to Eric Koleda in [Code.gs - date_add_and_subtract]( https://github.com/google/google-apps-script-samples/blob/master/date_add_and_subtract/Code.gs) to make available the custom fuctions in an add-on it's required to include at least one add-on menu, but this is not working at this time on testing mode.
NOTE: The originally referred page was removed but the Date add and substract add-on sample code is available at https://github.com/googlesamples/apps-script/tree/master/sheets/dateAddAndSubtract.
The "solution" to test a custom function add-on is to publish the add-on privately so you could avoid the Google review of an untested add-on. Related Q&A: Publish an add-on privately
NOTES:
You have to create a Google Cloud Project, set OAuth Consent Screen, add the Google Workspaces Marketplace SDK, complete the configuration page, the listing page and to publish the add-on
Setting the OAuth Consent Screen for Internal Use requires to a Google Workspace Account
Setting the OAuth Consent Screen for External Use limited to test account only doesn't allow to publish the add-on to the GW Marketplace.
One scenario is to use different Google Cloud Projects for testing and production but use the same Google Apps Script project. Another scenario is to have two different Google Apps Script projects each one with their own Google Apps Project and someway copy the code from one to the other i.e. using Google Apps Script GitHub Assistant Chrome Extension, CLASP or the Google Apps Script API.
Remarks
There are a couple of related GAS issues, please star them:
"Test as add-on" from standalone project to Google Sheets doesn't link custom functions
After activating an add-on, custom functions get stuck Loading... until spreadsheet refresh