I am new to programming in Google Apps Script. I wanted to create a script to manage Classroom in Google Sheets. The problem is that everything works fine in the test deployment, but nothing shows up in the normal deployment. I wanted to have a button for the script appear on the right side in the add-ons, which opens an empty CardService for a moment and then a sidebar with an HTML file.
Below is the JSON code:
{
"timeZone": "Europe/Warsaw",
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"dependencies": {
"enabledAdvancedServices": [
{
"userSymbol": "AdminDirectory",
"serviceId": "admin",
"version": "directory_v1"
},
{
"userSymbol": "Classroom",
"serviceId": "classroom",
"version": "v1"
}
]
},
"oauthScopes": [
],
"addOns": {
"common": {
"name": "Zarządzanie Classroomem",
"logoUrl": "://iili.io/dTYC3Dx.png",
"useLocaleFromApp": true,
"homepageTrigger": {
"runFunction": "createCard",
"enabled": true
}
},
"sheets": {
"homepageTrigger": {
"runFunction": "createCard",
"enabled": true
}
}
},
"urlFetchWhitelist": [
"://iili.io/"
]
}
And .gs file:
function createCard() {
let card = CardService.newCardBuilder().build();
let htmlOutput = HtmlService.createHtmlOutputFromFile('Sidebar').setTitle('Zarządzanie Classroomem')
SpreadsheetApp.getUi().showSidebar(htmlOutput);
return card
}
I can’t understand why everything works in the test deployment, but not in the normal deployment. I don’t know if the problem lies in the link to the image and the whitelist because I filled it out incorrectly. Maybe the error is due to a poorly constructed manifest file, or perhaps it’s related to accepting OAuth credentials. I would like to be able to open the sidebar with a button on the right side, not through the menu at the top on the toolbar.
I intentionally removed the https and oauthScopes before the links because the post was detected as spam.
kacper bednarski is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.