google-apps-script-web-application

Issues with global variables in Google App Script

烂漫一生 提交于 2020-08-10 23:02:55
问题 I'm trying to receive some data being sent to a webhook and work with it. I'm able to receive the data and convert it to a json String however I want to assign the json String to a global variable so I can use it elsewhere, and in other functions. I'm declaring the variable first and then trying to assign the json string to it when i receive it but it doesn't seem to be working - the variable is still 'undefined' var jsonData; function doPost(e){ try{ var jsonString = e.postData

Issues with global variables in Google App Script

荒凉一梦 提交于 2020-08-10 22:59:46
问题 I'm trying to receive some data being sent to a webhook and work with it. I'm able to receive the data and convert it to a json String however I want to assign the json String to a global variable so I can use it elsewhere, and in other functions. I'm declaring the variable first and then trying to assign the json string to it when i receive it but it doesn't seem to be working - the variable is still 'undefined' var jsonData; function doPost(e){ try{ var jsonString = e.postData

Get data from Google Sheets without Sheets API

房东的猫 提交于 2020-07-31 05:19:08
问题 I have created an app (React Native) where I am required to show the responses of a google form, so I created the Responses Sheet. Though Sheets API would be the best solution, I do not wish to use it (unless there is no other choice). Is there a way to get the data (csv/json/arrays?/anything else) from the sheet without using Google API? I only want the values from the cells, nothing else. Notes: I want to parse the data in JavaScript. 回答1: I believe your goal as follows. You want to

Google Script App Fails in Incognito Mode

一世执手 提交于 2020-07-26 13:17:25
问题 I have a simple Google Script published as a web app with anonymous access. The code is available here and the web app is available here. code.gs function doGet() { return HtmlService.createHtmlOutputFromFile("index").setTitle("Google Script") } index.html <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <p>Hello</p> </body> </html> The script web app works in normal Chrome mode but returns a 500 error when the page is viewed in the incognito mode of Chrome or Firefox. The

Google Script App Fails in Incognito Mode

我的未来我决定 提交于 2020-07-26 13:16:32
问题 I have a simple Google Script published as a web app with anonymous access. The code is available here and the web app is available here. code.gs function doGet() { return HtmlService.createHtmlOutputFromFile("index").setTitle("Google Script") } index.html <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <p>Hello</p> </body> </html> The script web app works in normal Chrome mode but returns a 500 error when the page is viewed in the incognito mode of Chrome or Firefox. The

Google Script App Fails in Incognito Mode

妖精的绣舞 提交于 2020-07-26 13:15:32
问题 I have a simple Google Script published as a web app with anonymous access. The code is available here and the web app is available here. code.gs function doGet() { return HtmlService.createHtmlOutputFromFile("index").setTitle("Google Script") } index.html <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <p>Hello</p> </body> </html> The script web app works in normal Chrome mode but returns a 500 error when the page is viewed in the incognito mode of Chrome or Firefox. The

Slides App: getActivePresentation error after v8 migration

无人久伴 提交于 2020-07-23 06:14:54
问题 Seems to happen when you are logged in with 2 different accounts to Google and test the app - 1 account in Chrome browser and another in Google Slides app or Apps Script panel. Other than that, all works fine. I have a function imageToSlide called from html template like this: google.script.run .withSuccessHandler(sidebar.onSuccess) .withFailureHandler(sidebar.onAddDocumentError) .imageToSlide(url, link, width, height); Inside it I do var presentation = SlidesApp.getActivePresentation();

Slides App: getActivePresentation error after v8 migration

泪湿孤枕 提交于 2020-07-23 06:13:22
问题 Seems to happen when you are logged in with 2 different accounts to Google and test the app - 1 account in Chrome browser and another in Google Slides app or Apps Script panel. Other than that, all works fine. I have a function imageToSlide called from html template like this: google.script.run .withSuccessHandler(sidebar.onSuccess) .withFailureHandler(sidebar.onAddDocumentError) .imageToSlide(url, link, width, height); Inside it I do var presentation = SlidesApp.getActivePresentation();

Slides App: getActivePresentation error after v8 migration

守給你的承諾、 提交于 2020-07-23 06:12:32
问题 Seems to happen when you are logged in with 2 different accounts to Google and test the app - 1 account in Chrome browser and another in Google Slides app or Apps Script panel. Other than that, all works fine. I have a function imageToSlide called from html template like this: google.script.run .withSuccessHandler(sidebar.onSuccess) .withFailureHandler(sidebar.onAddDocumentError) .imageToSlide(url, link, width, height); Inside it I do var presentation = SlidesApp.getActivePresentation();

Pass URL Parameters to HTML Form Google Web App

别等时光非礼了梦想. 提交于 2020-07-22 03:03:04
问题 I've gone through most of the relating questions regarding this and haven't found a solution that helps me (I've applied them one by one). I have an HTML form that I am publishing as a web app through google. I need to prefill an input box with that parameter. code.gs function doGet() { return HtmlService .createTemplateFromFile('html') .evaluate(); } html.html <!DOCTYPE html> <html> <head> </head> <style> </style> <body> <form> <h1><center>Verification</center></h1> Form ID:<input type=