google-apps-script

How to add my key to this google app script?

我只是一个虾纸丫 提交于 2021-01-28 10:50:15
问题 I need to update this script to pass my key so that I don't go over the limit per day. How would I modify this script to pass my key? (NOTE: google class information found here: https://developers.google.com/apps-script/reference/maps/geocoder) function geo2zip(a) { var response=Maps.newGeocoder() .reverseGeocode(lat(a),long(a)); return response.results[0].formatted_address.split(',')[2].trim().split(' ')[1]; } function lat(pointa) { var response = Maps.newGeocoder() .geocode(pointa); return

HTTP Post from the onOpen event/trigger

旧时模样 提交于 2021-01-28 10:38:11
问题 I'm having an issue with doing an HTTP Post in the onOpen event in google apps script. What I'm trying to do is send a notification to another deployed script that someone has opened one of our spreadsheets. I'd like this functionality to persist even when someone copies the spreadsheet so that we can track where those are as well. My problem is that if I call UrlFetchApp.fetch(url, options) from the onOpen event, I get the error - "Execution failed: You do not have permission to call fetch"

HTTP Post from the onOpen event/trigger

帅比萌擦擦* 提交于 2021-01-28 10:34:46
问题 I'm having an issue with doing an HTTP Post in the onOpen event in google apps script. What I'm trying to do is send a notification to another deployed script that someone has opened one of our spreadsheets. I'd like this functionality to persist even when someone copies the spreadsheet so that we can track where those are as well. My problem is that if I call UrlFetchApp.fetch(url, options) from the onOpen event, I get the error - "Execution failed: You do not have permission to call fetch"

Can we use Chrome V8 functionalities from GAS?

*爱你&永不变心* 提交于 2021-01-28 09:57:09
问题 Since Apps Script runs in Chrome V8 engine, would it be possible to use any of V8 functionalities from Apps Script? I was wondering if it will be possible to build tools like headless browser, webpage screenshot, etc using Apps Script. I haven't read on these though, but would if it would be possible. Thanks 回答1: V8 is an ECMAScript engine, which is just one part of a browser. It doesn't know anything about the DOM, or CSS, or rendering, etc. So no, you can't use it to render screenshots of

Add dropdown box in Google site

爱⌒轻易说出口 提交于 2021-01-28 09:35:54
问题 I have some data in Google sheet. How can i extract the data based on user request as per a dropdown box and generate it in Google Site . The challenges iam faced with. Prob_1- using a dropdown box in Google site Prob_2- generate dynamic data ( or table ) in google site from the Google spreadsheet. Analysis_1 - I have made a detailed study and understood that only using a third party plugin , i can make a select box. As a newbiew, needed some guidelines based on this. Is it not possible

Update cell values based on dependent drop down lists/multiple criteria

风格不统一 提交于 2021-01-28 09:05:43
问题 I've created a google sheet with dependent drop down lists based on this script/tutorial. Here's a copy of the sheet I've created. Instead of creating a drop down list like the one currently present in column C of the master sheet, my goal is to auto populate cells in column C with each unique value available in the drop down list. I've attempted this via VLOOKUP but only got errors in response, likely due to a lack of validation or some other form of logic I'm not familiar with. I'm also

Clasp Could not read API credentials. Are you logged in globally?

时光毁灭记忆、已成空白 提交于 2021-01-28 08:52:45
问题 I'm logging in with clasp login --creds <file> which produces a local .clasprc.json file. It says that I am logged in, but when I run another command I get: Could not read API credentials. Are you logged in globally? Any thoughts on why its not looking at my local clasprc file first? Currently using version clasp v. 2.2.0 回答1: I ran into the same problem on Windows 10 and found that you need to login both globally and locally to use clasp run . There should be a .clasprc.json file in both

Content not added to SendGrid template email before it is sent

拜拜、爱过 提交于 2021-01-28 08:47:56
问题 I am creating a script accessed by a button in Google Sheets that when clicked, sends emails. I want to use SendGrid to send my mails rather than Google's MailApp or Gmail . There is not a lot of documentation on how to use SendGrid with Google Apps Script. I need to use SendGrid templates, but when I pass it as a parameter, the sent message consists only of the header of the template and not the content. Why is this happening, and how can I resolve it? var SENDGRID_KEY ='My_key'; var headers

Capture date & time when cell is edited (google spreadsheet)

你离开我真会死。 提交于 2021-01-28 08:23:34
问题 I'm looking for a way to capture time & date (or maybe date only) when a cell is updated/edited. I found some tutorials while searching through the web, but I guess its a little outdated that it doesn't run 100%. here is the code I found function capdatetime(event) { var timezone = "GMT+8"; var timestamp_format = "MM-dd-yyyy"; //Timestamp format var updateColName = "Date Sent"; var sheet = SpreadsheetApp.getActiveSpreadsheet(); //Name of the sheet where you want to run the script var actRng =

Read a file with script

爱⌒轻易说出口 提交于 2021-01-28 08:14:52
问题 I want to get the content of a file (as string) with google script. It's a txt or html file which I want to edit as string after. The file is stored on Google Drive and I know the ID. What I know that you can access the file with: var Template = DriveApp.getFileById('18DEuu91FJ4rhTYd-xrlNpP2U9jfyheEI'); But I can nothing find how to read the content of this file like "file_get_contents" in PHP. 回答1: According to Googles Reference on the Apps Script you can use the getAs() method to return the