Access attached code for installed Google Add-on - google-apps-script

Basically the question is: Can a user access the installed Add-on's code in any way like e.g we can access through Tools Menu -> Script Editor(on SpreadSheets) while on development & pushed through clasp CLI?

Negative. Users who have installed the Add-On do not get to see the Add-On code. If they open a Apps Script editor instance from an editor in which an installed add-on is running, the user will get a blank Apps Script project template to work on, not the Add-On code.
They will however see the names of the functions executed in their Apps Script dashboard.

Related

How to programatically install Google Workspace add-on app which is deployed using gcp cloud run

I have created a Google Workspace Add app, which I created and deployed with cloud run.
Now I have to deploy the app to selected users in an organization after getting admin credentials using Admin Google API.
There is no way to install Addons programatically - be it through Cloud Run or Admin SDK, however you can do it centrally from the Admin Console
For this
follow the instructions for Automatically install apps and extensions
Go on https://admin.google.com/ac/chrome/apps/user
Select an organisatiomal unit where you want to apply the Force install (you might need to create this unit first and move to it all the selected users)
Click on the yellow "plus" at the bottom right and select "Add by URL"
Type in the Marketplace Listing of your Addon and click Save
Adjust Additonal Settings if necessary

How to give users access to app script managed by a GCP Project

I have an app script linked to a spreadsheet that has a few functions to automate some processes for users. I recently updated the project to be linked to a standard GCP project I created so I could create OAuth credentials for an unrelated process in this script. However, now when users go to run the functions, they get a 403. Is there a place in the GCP console where I can give them access? I am not using any OAuth credentials for these functions. Just the standard app script interactions with the Google Sheet.
I think when you move to GCP you are required to use OAuth and they have to enter their credentials again. Found in the docs.
You have to configure the OAuth Consent Screen as is explained in the official docs about link a Google Apps Script project to a standard Google Cloud Project --> https://developers.google.com/apps-script/guides/cloud-platform-projects

Can't run scripts anymore due to Error 401: deleted_client The OAuth client was deleted

I linked my google apps script project to a project on GCP. Then I deleted the GCP because I didn't need it. Now, I can't run scripts inside my google apps script project.
First, I got this popup. Then, after clicking the first button I get to error message in my subject line.
Originally, I linked from google apps script to GCP from the Resources/Google Cloud Project option. There is no option to unlink...
How can unlink my Google Apps Script from my now-deleted GCP.
As written in the documentation,
You can't switch a script project to use a default GCP project. Default GCP projects are deleted once the script project they were created for is set to use a standard GCP project.
You cannot unlink as the default project is deleted. You have to create a new GCP project and link to the new project, which will automatically unlink from it's old project.

can we open a command prompt from google appscript

I want to run a command prompt and give message to user on specific conditions.
Conditions/ logic is written in google appscript as we are using Gsuite files, is it possible to open my local command prompt and run a command like we do from powershell or vba.
No, in the way you are defining it that feature is not supported in Apps Script.
However, you might have heard of clasp which is a command line interface to develop and manage Apps Script projects from your terminal rather than form the Apps Script editor.
You will be able to manage versions of your projects, run, deploy and create scripts and so on. In this guide you can see an overview of all you can do with clasp. This is the clasp Github repository in case you are interested in taking a further look.

Google Sheets add-on not visible in Marketplace Apps for site-wide installation

I have followed all the steps here: https://developers.google.com/apps-script/add-ons/domain-wide
And then went through them a million times already.
I can install and use it if I click Test Installation Flow from under Google Apps Marketplace SDK Configuration.
When publishing, the check box for Publish in Google Apps Marketplace is always checked.
Still, when I log in as a domain administrator and go to Marketplace Apps - Add App, I can't find my app in the list.
If you're from Google support, here's the link to my app, maybe you can check something in the backend: https://chrome.google.com/webstore/detail/enabler4sheets/inpioilbljppoobbblcpbpjplkefmkep
Based from the Google Apps Script documentation, The add-on’s name must be the same as the name of the Apps Script project. The checkbox next to Publish in Google Apps Marketplace should be checked only if you are publishing the add-on for domain-wide install and you are not bundling the add-on with an existing Google Apps Marketplace app. See the style guide for more information on the other fields. Select the most recent version of your code and click Create web store draft. This will open a new page for you to configure the add-on for inclusion in the Chrome Web Store.
What I can suggest is to repeat the process based from the document. Please check the Complete application ad publish your add-on: https://developers.google.com/apps-script/add-ons/publish#complete_application_and_publish_your_add-on