google-apps-script

Google visualization API (gviz) query and fetching data from a spreadsheet

风格不统一 提交于 2021-01-27 21:29:00
问题 I am using the Google Visualization API to query a spreadsheet. If I paste the URL in the browser: https://docs.google.com/spreadsheets/d/14dIMLkVwHRo-bkvdIhaDwC-rGBHLefftlC6CCCs5YrWSc/gviz/tq?sheet=customers&tq=select+*+Where+A='27938' A is the customer ID column. I get this JSON looking text back: google.visualization.Query.setResponse({"version":"0.6","reqId":"0","status":"ok","sig":"7671558882","table":{"cols":[{"id":"A","label":"ID","type":"string"},{"id":"B","label":"FirstName",..... 1)

Is there an existing way in google script to check if an A1 notation is in range of a second A1 notation

痴心易碎 提交于 2021-01-27 21:22:14
问题 I am currently writing a function for this myself, could not find an existing function in the google docs. But I was wondering, this is so standard, there should be a default way to do this. I simply want to check if an A1 notation is in range of a second A1 notation. Example pseudo code: var range = "A33"; isWithinA1Range(range, "A3:A"); //returns true isWithinA1Range(range, "A:A"); //returns true isWithinA1Range(range, "A33"); //returns true isWithinA1Range(range, "A30:B35"); //returns true

Google Apps Script: How to check if a calendar event has been marked as deleted manually

风格不统一 提交于 2021-01-27 21:18:19
问题 I've written a Google Apps Script which adds events kept in a spreadsheet to a google calendar. Each event stores the calendar event's ID so that it can update it if the event in the spreadsheet gets modified. The event can still be deleted manually in the calendar so I would like the script to detect this and recreate the event. Unfortunately, I cannot simply check for null when calling getEventById(...) on a calendar object because even when deleted, this function seems to be returning a

I wrote a script to copy files to a backup folder but standalone webapp file gets copied to root instead

喜欢而已 提交于 2021-01-27 20:38:28
问题 Does anyone know why this happens? It would be much more convenient to have all the files copied to the destination. I have a list of filenames and file ids 3 are spreadsheets and one is a standalone script which I deploy as a webapp. The three spreadsheet go to the correct place. The standalone webapp goes to the root. I don't think it's a duplicate as suggested. function backUpProjectFiles(){ var backupFolder=DriveApp.getFolderById(getGlobal('BackupDirId')); var subFldrName='BackUpFiles_' +

Connecting a Hello sign API to apps script project

牧云@^-^@ 提交于 2021-01-27 19:12:18
问题 I want to Create a new API app usin Google Apps script and Hello sign API I have specified the redirect URL as https://script.google.com/macros/s/AKfycbyKw3oLmpqINGsDml281iUbxBboKn950dqVFXNibMfLurxYcRPf/exec and the screenshot is shown below Also, the code of the apps script file is function doPost(e) { return ContentService.createTextOutput("Hello API Event Received."); } The documentation says: https://app.hellosign.com/api/eventsAndCallbacksWalkthrough I get error message as shown like

Google Sheets Copy down formula with inserting a row

ⅰ亾dé卋堺 提交于 2021-01-27 18:36:22
问题 I am transitioning from Excel and VBA to Google Sheets and admittedly, don't know JavaScript. I see that there is a common request for some VBA which will copy down the formulas from the row above, when I insert a new row anywhere in the dataset. I know how to add a butt, and i used the Macro Recorder to record the insertion of a Row, but the recorder only records that particular row that I chose to insert above. I'd like the script to grab the activecell row number, so that it is dynamic on

Google Apps script: “We're sorry, a server error occurred. Please wait a bit and try again”

泪湿孤枕 提交于 2021-01-27 18:09:05
问题 I am using Google Apps script to set up a spreadsheet merge to a from letter that will be emailed. I copied a similar script and added my info. Everytime I try to save it I get the "We're sorry a server error occurred. Please wait a bit and try again." // dixie@yellowdogknitting.com // Job Offer Letter // Get template from Google Docs and name it var docTemplate = "1Y5ohbBWPeLSvNijge6I3ueQpulFzeZTky7853sKGSj8"; var docName = "HR_2_Job_Offer_form_letter"; // When Form Gets Submitted function

Google Apps script: “We're sorry, a server error occurred. Please wait a bit and try again”

陌路散爱 提交于 2021-01-27 18:03:09
问题 I am using Google Apps script to set up a spreadsheet merge to a from letter that will be emailed. I copied a similar script and added my info. Everytime I try to save it I get the "We're sorry a server error occurred. Please wait a bit and try again." // dixie@yellowdogknitting.com // Job Offer Letter // Get template from Google Docs and name it var docTemplate = "1Y5ohbBWPeLSvNijge6I3ueQpulFzeZTky7853sKGSj8"; var docName = "HR_2_Job_Offer_form_letter"; // When Form Gets Submitted function

Trigger importHTML in Google Apps Script

╄→гoц情女王★ 提交于 2021-01-27 16:32:04
问题 I'd like to know whether it is possible to write a Google Apps Script that will trigger daily importhtml in Google spreadsheets. For example let's assume I want to import updates of following table everyday at 1 pm. =IMPORTHTML("https://en.wikipedia.org/wiki/Lubbock,_Texas","table",5) I need this automatic checking for table updates even when my computer is offline. Thank you 回答1: Yes, it is possible to write a script to make a copy of the table every day. In short, you will have to make a

GmailApp.getAliases() returns a blank list

狂风中的少年 提交于 2021-01-27 14:31:58
问题 I have a user with aliases. In admin.google.com I can view all the aliases, but when with that user, I create a Google Apps Script with only this code: var aliases = GmailApp.getAliases(); Logger.log(aliases); The log is empty: "[]". I try to create the script also with an Super Admin User and Admin Directory API enabled but the result is the same. I need this method to send email like this: GmailApp.sendEmail(email , "Subj.. ", "body....", {from: aliases[0]}); Why isn't this working? 回答1: