getting “This app isn't verified” for Google Sheets script that only touches my sheet

假装没事ソ 提交于 2020-02-04 00:06:08

问题


I'm working on a Google Sheets script that I'm only intending to access data in the same spreadsheet that the .gs file is associated with. It seems like I should have permission to run a script in my own spreadsheet, but whenever I run a function, I get a This app isn't verified message.

How do I bypass this? I've already enabled the Google Sheets API in both Advanced Google Services and the API Console. Am I wrong in assuming that if I create a spreadsheet and create an add-on that modifies that spreadsheet, that I shouldn't have to authorize it?

Here's the function that's throwing the error:

function getLastRow(){
  ss=SpreadsheetApp.getActiveSpreadsheet();
  var rulesSht=ss.getSheetByName('rules');
  return rulesSht.getLastRow();
}

回答1:


When "This app isn't verified" is displayed, the screen will be not displayed by authorizing once to use scopes which are used in the script. When users use APIs of Google, they are required to authorize for the scopes which are used in scripts. The flow of authorization is as follows.

  1. When "This app isn't verified" is displayed, click "Advanced".
  2. Click "Go to filename(unsafe)".
  3. Confirm scopes and click "ALLOW".

By this, the screen will be not displayed when you run the script again. When you modified your script, if new scopes are detected, the screen is displayed to authorize new scopes again. Such scopes are automatically detected at script editor. That authorization is required to do only once.

Note :

  • In your snippet of question, you can use the script without enabling Sheets API at Advanced Google Services and the API Console.

If I misunderstand your question, I'm sorry.



来源:https://stackoverflow.com/questions/48482260/getting-this-app-isnt-verified-for-google-sheets-script-that-only-touches-my

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!