![]() You'll also need to invite them to the entire GCP project so the collaborators can view logs from add-on execution. To fully collaborate, its not enough to share the add-on script with another user. and then reload the sheet one last time to have the custom menu disappear.re-run the option again as that would store a document prop indicating that the custom menu is no longer needed (along with a simple toast indicating that the script if "finally" authorized).click on the custom menu option as that would prompt them to authorize the container-bound script.refresh the sheet once they try creating a webhook from the add-on and that shows them a new custom menu.For the time being, users are required to. ![]() And, to have the script assigned to a user-managed project, users will need to go through the entire process of creating a GCP account (if they don't already have one), enabling necessary APIs, setting up OAuth consent screen etc.Īuthorizing script form a custom menu doesn't run the actual script function - I'm unsure if this is a bug or an intended behavior but this was the only workaround I could think of to authorize the newly minted container-bound script without having the users open the Apps Script editor. Funny thing about that is you can only make a script API Executable if it’s a user-managed project (and not the default one which is assigned for container-bound scripts). The obvious answer here would seem for us to use the n endpoint but this only works if the script is made to be API Executable. ![]() Deploying the script/project as a web app using the Apps Script REST API (ref: endpoint) doesn't mean that its authorized to accept incoming requests.To assist user with this step, I created the following prompt for them to easily understand what needs to be done and what changes they can expect to see - Name me to save me To avoid triggering the API for detecting whether or not the sheet has been saved and to make sure that the add-on doesn't proceed to next steps before renaming the sheet, I make use of getDocumentProperties() method inside a global variable within the add-on, which throws an error if its unable to instantiate (that happens to be the case if the sheet is not saved). "message": "Requested entity was not found.", In case you don't save the sheet and try creating a script anyway, you'll run into the following error. Usually, renaming the sheet or making some edits to it will do the trick.Saving the sheet is important - when you're trying to create a container-bound script using the Apps Script REST API (ref: endpoint) on a freshly created Google Sheet, its important to first have the sheet saved on the Drive.Here are the top 5 things I hadn't known about until I'd actually started working on this add-on: And finally, deploys the project (ref: endpoint) and since the manifest file contains the following configuration, it is done so as a Web App.Creates a new project version (ref: endpoint) which is required to deploy a script.Updates the script (ref: endpoint) with all the files listed in this GitHub repo's Webhooks folder.Creates a container-bound script (ref: endpoint). ![]() The add-on does the following activities using the Apps Script REST API.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |