0

As my association has changed from using Google Drive with common accounts (someone@gmail.com) to using it with Google Workspace accounts, I have to modify all my scripts so they can work on the new workspace.

From what I understood from this link : Google Script Document Inaccessible Error - creating and attempting to open document in code I need to go through GCP to allow me to make a copy of a document and then modify it.

In order to do this, I need to retrieve various OAuth tokens but for that I need permissions (for example iam.roles.list or resourcemanager.projects.get). I can't get these permissions even though I'm an admin (with an associative account so it's free but has paid features).


My question is: why can't I give permissions and how do I give these permissions?

A subsidiary question: Do I really do it right? The GWorkspace method seems extremely complicated compared to the GDrive version for the same result.


Thank you very much for taking the time to read my message, and thank you for your help.

(To avoid any English mistakes, I used deepl : Translated with www.DeepL.com/Translator)

Rubén
  • 34,714
  • 9
  • 70
  • 166

1 Answers1

0

As using Google Drive with common accounts have some restrictions that using it with Google Workspaces accounts there isn't you only have to change your scripts if you want to use features that now are available, otherwise you might only need to

  1. Share the script containers as documents, forms, slides and/or spreadsheet or stand alone scripts with your Google Workspace account
  2. Make a copy the containers or stand alone scripts

Creating a Google Cloud Platform standard project will be only necessary if you need to enable APIs that aren't available as advanced services, if you want to publish your scripts as add-ons among other tasks.

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • I did share the GSheet that contains the script in question to make a copy to the new Workspace. But when I try to Execute the script it says `Exception: The document is inaccessible. Please try again later.` after I make a copy of a document and I try to open it. Here is the code that throws the exception : `var RM = RM_TemplateVari.makeCopy(refRM1,FolderIntervenants1); var RMid = RM.getId(); var RMBody = DocumentApp.openById(RMid).getBody();` – Yoann OLLIVIER Feb 16 '21 at 13:21
  • Nevermind, I found the problem. Thank you very much for you time @Rubén ! (one of the document was a docx instead of a gdoc) – Yoann OLLIVIER Feb 16 '21 at 13:31