Google Apps Script (GAS) is a JavaScript cloud scripting language that lets you extend Google Apps and build web applications.

learn more… | top users | synonyms (1)

2
votes
1answer
372 views

Updating logging sheet from another sheet doesn't work after inserting code offset

I am trying to log the data, formulas and times of cell edits from one sheet into a logging sheet. The problem I am having is that it only seems to record changes made in the logging sheet. This has ...
2
votes
2answers
2k views

How do you add a custom font size in Google Spreadsheets?

How do I add a custom font size for a Google Spreadsheet I have? There are some defaults like 14pt, 18pt, 24pt and 36pt, but I would like to have a font size like 30pt, is it possible?
2
votes
1answer
106 views

Can I trigger a Google Apps Script with a HTTP POST?

I've been looking through all sorts of info about Script and haven't really found anything in regards to triggering a script with a HTTP POST. I'm looking to send one or two POST requests per hour to ...
2
votes
1answer
107 views

Register your Apps Script application and retrieve the client ID and secret for oAuth dance

How do I register an Apps Script project and get the Client Secret for oAuth, and set the callback url?
2
votes
1answer
84 views

Access Google Spreadsheet revision history through API

Is there any way I could access Google Spreadsheet revision history through the API? The reason for that is I have a lot of sheets and simply relying on build-in revision history does not suffice to ...
2
votes
1answer
40 views

How can specific columns of a Google spreadsheet be exported as CSV?

I have a Google spreadsheet with 10 columns of data. I would like to export columns A, C, E, F as csv. I do not need to export the entire spreadsheet. Can this be done? I do not mind using Google ...
2
votes
1answer
90 views

How do I use a negative DURATION formatted cell from Google Spreadsheets in Google Scripts?

I'm using Google Spreadsheets and I have a sheet in the following format: Start | End | Partial result | Expected | Total 08:00 | 12:00 | 04:00 | 05:00 | -01:00 14:00 | 18:00 | ...
2
votes
1answer
164 views

Fixing permission problems in cross-spreadsheet import when using Apps Script

I created a function in the Apps Script associated with a spreadsheet: function importNotes() { s = SpreadsheetApp.openById('spreadsheet-key').getRange('F2').getNotes(); return s; } ...
2
votes
2answers
1k views

How can I trace precedents in Google Sheet

In Excel we can trace precedents and dependents. Can some one help me with something similar for Google Sheets? I have got the code for dependents from http://webapps.stackexchange.com/a/50149/88163. ...
2
votes
2answers
537 views

How do I refresh script results when a cell color is changed?

I have a Google Spreadsheet that contains a script to count a number of cells by color. The script works perfectly but seems like when ever I change the color of the cell, the count is not updated. ...
2
votes
2answers
255 views

Incrementing value read from spreadsheet exploding. 1 + 1 = 200 000 000 000

I read a value (in this case 7) from a Google Spreadsheet with a script, increase that value using source++ and write the increment back to the spreadsheet. I expect a series of 7, 8, 9, 10. ...
2
votes
1answer
4k views

Date and time stamp automatically added in column [duplicate]

We have a barcode scanner that we use to track student assignments. I am trying to create a Google Spreadsheet that tracks the assignments for each subject. I have been using the following script: ...
2
votes
1answer
687 views

Arrayformula with dates before and after

Here is what my spreadsheet looks like I enter recurring weekly payments details in G,H,I,J & K (Name,Amount,Day of week, Start Date, End Date respectively). This arrayformula: ...
2
votes
1answer
37 views

Auto create sheets within a spreadsheet with formatted columns and cells

What I would like to do is be able to run the script and have it create 4 new sheets (within the current sheet I'm in) with the following formatting in each: 1st row frozen with column headings on ...
2
votes
2answers
89 views

Google Sheets/Forms/Script: How to send an email then replace “@” with “#”

I am trying to create a script where the user gets an email (column 1) with the body being column 2. However, after that, I want to replace the "@" in the email with a "#" so that they do not get the ...
2
votes
1answer
78 views

Google Form with an alert

I created a registration form with Google Forms. Now I would like to have an alert displayed before the submitter starts filling out data. This is my code: function onOpen() { FormApp.getUi() ...
2
votes
1answer
51 views

Auto calculate and display timestamp in a specific row and column

I have a spreadsheet with a formula that works to display the timestamp in the same row, but is there a way to set a column at the same time so I don't have multiple time stamps displaying along that ...
2
votes
1answer
62 views

How do I get multiple driving times in Google sheets without “Service invoked error”?

I keep getting this error. "Service invoked too many times for one day: route. (line 3)." Here is the link to my sample sheet. With script attached ...
2
votes
2answers
79 views

How to retrieve the HTML content of a Google Sites footer with a Google Apps Script?

I cannot find in documentation an equivalent to getSummary() or getTitle() to retrieve the HTML content of a Google Sites footer (the custom footer editable through Edit site layout > Custom ...
2
votes
2answers
46 views

Sum all expenses of a given type given a list of expense types in a separate sheet

I use Google Sheets to keep track of my expenses. The file currently consists of: Sheet 1: "Expense Types" Sheet 2: "2015 Details". The first column of Sheet 1 contains the list of admissible ...
2
votes
1answer
761 views

Clear range of cells

I'm trying to make a script for Google Spreadsheets (which is my first time), by clearing a range of some cells. So: for example I want to clear D5:D12 but not D13 and D14, but then again I want to ...
2
votes
1answer
130 views

Import Google Contacts to Google Spreadsheet

Google notice me : You do not have permission to call getContacts (line 3) Here is my code: function importFullName(input) { var CONTACT = ...
2
votes
1answer
371 views

Adding a script to Google Forms to identify incorrect phone numbers

I currently use Google Forms as a way for applicants to submit their forms. One of the fields that is required is for their contact information. In my country phone numbers have 11 digits. Is there a ...
2
votes
1answer
2k views

How can I reference a cell in a custom function while setting up data validation in Google spreadsheets?

I made the following Google script to check whether a string is less than some length: function isLengthLessThan(length, text) { return (text.length < length) }; How can I set up data ...
2
votes
1answer
112 views

Formula value change after a script pastes into another range

I have a script that pastes a formula from one cell into a range in a column. When pasted the range just disappears. I mean the whole formula is OK except the pointer. Any ideas how to deal with ...
2
votes
1answer
6k views

Get cell row and column index in Google Spreadsheet

I have spreadsheet with two sheets inside. The name of the first sheet is "fr" and the name of the second sheet "cql". Now the first sheet contains data as the picture given below. And the second ...
2
votes
1answer
72 views

How to capture a cell when entered or selected?

I am trying to capture, programmatically, the on cell entered and on cell selected method, but I don't seem to be able to find any documentation on it. I can get the time stamp for exiting the cell ...
2
votes
2answers
172 views

How can I apply a script to every sheet but the first one on a spreadsheet?

I've been working on a shared Google spreadsheet on Google Drive. The document has different sheets with a "Last Modified Date" Cell. I found an script for this to be auto-filled searching here: ...
2
votes
1answer
2k views

Get the Id of the response from Google Forms via a Google Apps Script

How do I get responseId ? var form = FormApp.openById('myGoogleFormID'); var response = form.getResponse(responseId); function onSubmit() { // Here I'd like to get the id of the current response } ...
2
votes
2answers
257 views

onEdit only updates top row after pasting (editing) multiple rows

I'm using a Google Spreadsheet and have a script that updates the "last email" column with a date stamp when an employee enters an email address into the prior column. The problem occurs when my ...
2
votes
1answer
980 views

Google Apps Script - exceeded maximum execution time

I'm currently developing a new spreadsheet for my company to make one of the tasks we do on a weekly basis more easier - the way it works is data is imported into this spreadsheet and then the scripts ...
2
votes
2answers
4k views

How do I create a multiple choice question in Google Forms based on spreadsheet data?

I am making a Google Form for evaluations. I will have a multiple choice question in there and the available options have to come from a list of items, say on a spreadsheet or a text document. I have ...
2
votes
1answer
847 views

Can I map specific parts of a Google Form to one spreadsheet, and other parts to another spreadsheet?

Can I map specific parts of a Google Form to one spreadsheet, and other parts to another spreadsheet? Some of the responses on one will be public and viewable by anyone, but others will be private.
2
votes
1answer
468 views

Repeat range under each other in Google Spreadsheets

I have a range of two columns with year and dates. In another sheet I want to repeat this range for X amount of times under each other. How can I do this? So for example I have this range: Year | ...
2
votes
1answer
1k views

Batch copying/renaming in Google Docs

I need to copy and rename a base form (a spreadsheet) to several other forms in Google Docs. Imagine I have the following form: My Base Form - @name (@course) After running the script or whatever, ...
2
votes
1answer
18 views

Can I set a trigger to run every second?

While searching for answer to How can I trigger a function when switching sheets within a spreadsheet? I noticed that the Triggers for current project dialog has an option for specifying a trigger ...
2
votes
1answer
26 views

ImportRange as dependent function

I am trying to write a script which set the function importRange in a specific cell, using us KEY the content of another cell. I have the list of the KEYs in Sheet2 and here is what I wrote so far: ...
2
votes
1answer
28 views

Delete events from Google Calendar with a specific word in the title

I'm trying to delete specific events on my Google calendar, I've found this script that delete events with a specific title: function delete_events() { //take care: Date function starts at 0 for ...
2
votes
1answer
32 views

Add email hyperlink to spreadsheet

I have a spreadsheet where I track incoming email questions and outgoing responses. As questions come in, I have a script that appends a row (using .appendRow()) with information in the first few ...
2
votes
1answer
53 views

Can I add two calculated fields to a Google Spreadsheet based on a Google Form?

I am new to Google Scripts and am hoping for some guidance on improving a manual process I complete in Google Sheets. To analyse the data I receive on a Google Form I run, I manually add-in (or copy ...
2
votes
1answer
42 views

Periodically updating a URL in the ImportXML command with a script

I am using importxml to extract prices from multiple websites. My main concern is to be able to refresh the prices whenever I want and not be dependent on Google's hourly update. I am using this ...
2
votes
1answer
36 views

Auto Sort Google Sheet with onEdit function

The following function successfully sorts my file (containing 3 sheets) individually. When I hit the "play" button on the script, it properly sorts (as expected) the current (active) sheet. Since my ...
2
votes
1answer
78 views

Print several non-consecutive columns of a Google Spreadsheet using a script

I have script for print. I need print range without some column (e.g. print just B,C,D,E,G and miss F) and without all notes in sheet. The script below prints all the columns. function printPdf() { ...
2
votes
1answer
397 views

Import JSON to Google Sheet using Google Apps Script

I am using Apps Script in Google Sheets to import JSON from Google Analytics. I have previously used the ImportJSON function to easily get the JSON from an open API just using =ImportJSON(url) within ...
2
votes
1answer
60 views

Can this script be more optimized and why is it running slow sometimes?

I just started using Google App Script and wrote this script (mostly copy and paste) to check the status of my website and its pages. Sometimes, mostly after opening the spreadsheet, but even if it ...
2
votes
2answers
225 views

Automatically copy and paste cells that have just been updated to a list from forms

I have a spreadsheet that collects information from two different forms. Each form feeds a different sheet in the spreadsheet. There are 3 other sheets that the info from either of the first two forms ...
2
votes
1answer
43 views

How can I round a Google Form input to nearest .5?

I'm trying to write a script that will calculate based on user input from a Google Form and then send a customized email based on the input provided. I've written an apps script bound to the ...
2
votes
1answer
63 views

Rearranging Google form data in a new sheet

I am trying to use a form to create a list of jobs for our student employees, which exists as an editable Google sheet. The thought, being any of the staff could add jobs that need to be taken, by ...
2
votes
1answer
435 views

E-Mail from Google Spreadsheets: including image for signature takes out formatting of message

Following situation: Sending emails from google spreadsheets. I have a compiled text (with line breaks), which is stored in var message. I have been trying to include a picture for the signature. To ...
2
votes
1answer
66 views

“getAs()” error - send an Email with Attachment using GoogleAppScript [duplicate]

I am very new to GoogleAppsScript and struggling. Here is my problem: Trying to send multiple E-Mails via Spreadsheet. Want to attach a PDF to those mails. Getting the following error: TypeError: ...