3

I have a number of Google Apps Script Web Apps that allow anyone with a link to the apps script to read and update some of my google drive spreadsheets.

Inside the app I gain access to the spreadsheets via

SpreadsheetApp.openByUrl(spreadsheet_url)

With the upcoming changes to Google Drive that require a resource key to access files:

Question 1: do I need to change the URL within each of the the Google Apps Scripts to continue to get access , and if so, how do I get the new URL?

Question 2: For users to access the Web App GAS, do I need to update the link to the Web App GAS with a new URL, and if so, how do I get that new URL for the Web App itself.

Rubén
  • 34,714
  • 9
  • 70
  • 166
Chris
  • 33
  • 5
  • 1
    I just got off a chat with Google who have told me that every link within my apps scripts will need to change, and all on the same day the change to drive resource is implemented. So I will have to take all my apps offline, change every link in every Web App and test it, and then take them back online. Seems ridiculous not to have any seamless migration option. Am I missing some seamless migration option?? – Chris Jul 08 '21 at 02:00
  • 1
    What do you mean by "a chat with Google"? – Rubén Jul 08 '21 at 04:57
  • 1
    I used the contact support as a Google Admin and got an online chat with their support. See below: Chris: So every app I have needs to be changed ????? Chris: And all on one day?? Google Workspace Support: Most likely yes. I do apologize if this will be a hassle on your end but there is a high chance that those links will need to be updated. Google Workspace Support: As far as the official communication for this feature goes, there is no transition that will happen as of yet. I do apologize. – Chris Jul 08 '21 at 07:32
  • 1
    Thanks for your reply. On my own experience and what I have heard and read from others Google Workspace Support doesn't answer questions about Google Apps Script, they usually redirect here (: – Rubén Jul 08 '21 at 14:41
  • 1
    Hi. I got a reply from google support - confirming exactly what you have all said. "I assume that means the URLs to the spreadsheets accessed as "Me" by the apps, will not change. Yes, that is correct. This security update would not apply to your current situation. Regarding the web app URL's, they are not Drive files so they should not get affected by this update either." So that you all for your help. Much relieved. :) – Chris Jul 10 '21 at 08:07

2 Answers2

2

As stated in the update feed, this security update is optional

Follow the instructions and you will have the option to remove this security update - either for all files or the specific ones you are accessing within your WebApps.

enter image description here

Sidenote:

As for updating the link to the WebApp URL - if you perform a change to your WebApp, you need to deploy it as a new version.

  • If you use the legacy editor - the WebApp URL will remain the same.
  • If you use the new editor - the WebApp URL wil cahnge eacht ime you deploy it as a new version.
ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • 2
    Nowadays the new editor allows to update the version to be used on a deployment, so it's not necessary to do a new deployment. – Rubén Jul 08 '21 at 14:36
1

As was mentioned on the previous answer, please bear in mind that you might opt-out of the Google Drive file links update.

Regarding code, the updates blog only mention changes that might be required when using the Google Drive API, not when using the Google Apps Script Workspace Services, the Google Apps Script release notes doesn't include anything related to this. Anyway, to feel "safer", you might replace openByUrl by openById as the files ids will not be changed.

Regarding the Web App URL, it is not a Google Drive file, so doesn't use the Google Drive sharing feature, so it will not change.

Resource

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