admin管理员组文章数量:1201570
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();
}
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();
}
Share
Improve this question
asked Jan 28, 2018 at 1:22
sigilsigil
9,54643 gold badges126 silver badges216 bronze badges
2
|
3 Answers
Reset to default 18When "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.
- When "This app isn't verified" is displayed, click "Advanced".
- Click "Go to filename(unsafe)".
- 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.
I had the same problem with a script I intended for distribution to other people. After some experimentation I found that it was that one of my function titles contained the word "show" and removing that took away the error.
I am unable to find any documentation on why that would be, but removing it solved the problem. Perhaps trying different names and submitting a ticket to Google with the word that caused it may be the best that can be done at this point.
If your app script needs to work only with a spreadsheet that it was installed in, you should explicitly define this scope https://www.googleapis.com/auth/spreadsheets.currentonly
in appsscript.json
manifest (docs):
{
"timeZone": "America/New_York",
"dependencies": {
},
"oauthScopes": [
"https://www.googleapis.com/auth/spreadsheets.currentonly"
],
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8"
}
To view your appsscript.json
go to Project Settings
and check
Show "appsscript.json" manifest file in editor
本文标签:
版权声明:本文标题:javascript - getting "This app isn't verified" for Google Sheets script that only touches my sheet - S 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738610677a2102614.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
//@OnlyCurrentDoc
annotation comment (which will prevent the access of anything outside of this document), or declare your OAuth scopes as read-only. You can find more details in the official documentation. – tehhowch Commented May 3, 2020 at 17:25