Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make an apps script to instantly allow access to all imported elements in a Google Spreadsheet?

I have to work with google spreadsheets. I am using some template spreadsheets which all contain a lot of links to other spreadsheets. The problem is that whenever I make a copy of the template spreadsheet to use most of the links(created with the importrange function) require me to give them access again enter image description here

What I want to do is make a script that would allow me to import all the links in one press. I tried to make an app script but I can't found any way to access the textbox with the "allow access" button so that i can make my script. My questions are: is there any way to access the "allow access" button programatically? or is there any other way to solve my problem and allow access to all links in one press?

like image 691
Daniel Sindrestean Avatar asked Aug 07 '14 08:08

Daniel Sindrestean


People also ask

How do I link an app script to a Google Sheet?

Open the Apps Script project. Click Editor code. Next to Services, click Add a service add . Select Google Sheets API and click Add.

How do you grant permission to pull data from other spreadsheets using Importrange?

About Granting Access With IMPORTRANGEThe first time the destination sheet pulls data from a new source sheet, the user will be prompted to grant permission. Once access is granted, any editor on the destination spreadsheet can use IMPORTRANGE to pull from any part of the source spreadsheet.

How do I give an app a script access?

You can grant the Apps Script API access to your script projects using the Apps Script dashboard. You can also use the dashboard to revoke this access at any time. When you grant the API access, you are doing so for all applications. Individual applications still need to be authorized, however.


1 Answers

I had to face to the same issue. The only way to avoid this Allow Access for importrange is to put the linked document (destination of the importrange) public, or shared by the link, which is public too, but if readers have the link. Then there is no requirement of authorizing importrange. Google should avoid this authorization access if the 2 documents are from the same owner, I don't understand where is the security breach here.

like image 145
Cédric NICOLAS Avatar answered Sep 30 '22 06:09

Cédric NICOLAS