google-apps-script

Appscript: Add data from Google Spreadsheets to Firebase RealtimeDB node

牧云@^-^@ 提交于 2020-07-22 11:07:09
问题 Im trying to add data from google's sheets to firebase. This is my spreadsheet and this is what im trying to achieve -> RealtimeDb This is what i have done so far, but it creates new node Items and put only the values without their names. Like What it does --> Items >0 1: 'name of the product' 2: 'product barcode'..etc ------------------ What i want --> Items > examplebarcode : itemname : 'radeonRX' itembarcode: '234523523523' var secret = '...' function getFirebaseUrl(jsonPath) { return (

ScriptProperties & UserProperties had been deprecated

佐手、 提交于 2020-07-22 09:19:48
问题 The documentation for the PropertiesService lists both, the ScriptProperties and UserProperties as: Deprecated. This class is deprecated and should not be used in new scripts. ... while the DocumentProperties seem to have no page in the documentation. Q: is there any suitable replacement for these classes, in order to use them in new scripts? 回答1: The replacement for the deprecated classes is the class Properties. PropertiesService has three methods getDocumentProperties() ,

How to apply google appscript to all google docs

泪湿孤枕 提交于 2020-07-22 06:10:46
问题 Below solution is intended to generate auto-increment ID as replacement to default name "Untitiled document" of googledocs. Autoincrement filename in Google Docs? The solution was clear to me. However, I'm thinking an option on how to apply this script to all google docs that will be created on the fly ? Maybe add-ons ? 回答1: Answer: Auto-renaming documents can't be done on-the-fly, that is to say, there is no way of making a script run automatically on document creation. You can however check

Run function asynchronously in Google Apps Script

空扰寡人 提交于 2020-07-22 06:01:44
问题 I'm making a Slack bot that calls a GAS function. Everything is working except Slack shows an error message because it only waits 3 seconds for a response when calling an API. Can anyone help me to work out how to run everyDay2 asynchronously so that I can return the response before it's finished. I've tried Promises and callbacks but I can't solve it. function doPost(e){ const promise = new Promise(everyDay2); return ContentService.createTextOutput('thinking...'); } 回答1: Promises doesn't

Converting Stripe API syntax to Google Apps Script

醉酒当歌 提交于 2020-07-22 05:50:32
问题 This SO answer correctly explains that since the require Node/JS library is not supported by Google Apps Script, the following code changes must be made to get Stripe to work properly in a GAS project: from const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); (async () => { const product = await stripe.products.create({ name: 'My SaaS Platform', type: 'service', }); })(); to function myFunction() { var url = "https://api.stripe.com/v1/products"; var params = { method: "post",

find and select a cell based on URL in google sheets

心不动则不痛 提交于 2020-07-22 04:55:48
问题 I made a simple sheet based database for chemicals using google sheets. The sheet looks like this: https://docs.google.com/spreadsheets/d/e/2PACX-1vR0-AMEKNM3ZbDq67OIKWnc7E3KP8kfOsnr0Bjg2OSjpevLLjniknGXfIiiyZvbwE9bz3EfbOpO46ef/pubhtml?gid=292509613&single=true There are many rows and columns. A user can change a value of a cell using a url link something like this https://docs.google.com/spreadsheets/d/13sLioJr_T6lqQ7y_pStBR8CKxReYwLUn4hao/edit#gid=292509613&range=B2 the link is converted to

find and select a cell based on URL in google sheets

删除回忆录丶 提交于 2020-07-22 04:55:08
问题 I made a simple sheet based database for chemicals using google sheets. The sheet looks like this: https://docs.google.com/spreadsheets/d/e/2PACX-1vR0-AMEKNM3ZbDq67OIKWnc7E3KP8kfOsnr0Bjg2OSjpevLLjniknGXfIiiyZvbwE9bz3EfbOpO46ef/pubhtml?gid=292509613&single=true There are many rows and columns. A user can change a value of a cell using a url link something like this https://docs.google.com/spreadsheets/d/13sLioJr_T6lqQ7y_pStBR8CKxReYwLUn4hao/edit#gid=292509613&range=B2 the link is converted to

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=

google.script.run.withSuccessHandler() returns Undefined

一世执手 提交于 2020-07-21 02:57:25
问题 I created an array in a separate GS file using the code provided below. I tried calling it in my HTML file. My goal is to compare the contents the array to the parameter email . However, the value returned by google.script.run.withSuccessHandler() is undefined //in GS function mailGetter() { //open sheet var sheet = SpreadsheetApp.openByUrl("https://sheet.url").getSheetByName("Email Sheet").activate(); //get size of given row range var row_data_email = sheet.getRange("C2:C").getValues(); var

google.script.run.withSuccessHandler() returns Undefined

南楼画角 提交于 2020-07-21 02:56:29
问题 I created an array in a separate GS file using the code provided below. I tried calling it in my HTML file. My goal is to compare the contents the array to the parameter email . However, the value returned by google.script.run.withSuccessHandler() is undefined //in GS function mailGetter() { //open sheet var sheet = SpreadsheetApp.openByUrl("https://sheet.url").getSheetByName("Email Sheet").activate(); //get size of given row range var row_data_email = sheet.getRange("C2:C").getValues(); var