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)

1
vote
1answer
55 views

Automatically record daily values in a new column

So I have this spreadsheet I use to control Content funnel. I've come up with a few formulas to use something else than a pivot table. But in order to get the trends and alarms I'm looking for, I need ...
1
vote
1answer
46 views

How to receive a notification when changes are made to a specific tab in Google Sheets?

If would like to receive an email notification if a new row is added to a specific tab in a Google Sheets. The default notification rule settings are too limited and the Google Sheets Add-on Store ...
1
vote
1answer
185 views

Send recurring reminders to Google Form respondents

I need to create a Google form like below : My objective is to send an reminder of Activity Described in < Your Activity > Question Then I need to send reminder email to email mentioned in < ...
0
votes
0answers
75 views

google.script.run.withSuccessHandler not working

In my Google Sheet script's page.html, I have <input type="button" value="Apply" onclick="google.script.run.setAttributes('abc');"> where setAttributes() is a function defined in Code.gs. ...
1
vote
1answer
47 views

How should I automate graph generation and image output in Google Sheets?

I am trying to send graphs of data to email recipients. I would like to output images of row-specific graphs based on cells in a Google Sheets document. In combination with Google Sheets/Drive, I am ...
1
vote
2answers
320 views

Basic date manipulation in Google script

I would like to define a custom function in Google Sheet. This function should do something very simple, yet I have not managed to find how to do it. I am very confused with all the answers I read ...
1
vote
0answers
21 views

DocumentApp highlight NamedRange - use Comment?

I'm using NamedRange a lot in my script and I would like to highlight it's position in document. I'm currently toggling background color of it via custom button, but this is not convenient. I would ...
1
vote
1answer
139 views

How to retrieve email address of current user?

In Google Spreadsheet I am having the following issue: I am using Session.getActiveUser().getUserLoginId() to fetch the current user's email id but other than creator of the spreadsheet it is ...
3
votes
1answer
166 views

Adding a Month to a Date in a Google Spreadsheet with a Script

I'm trying to create a Google App Script that adds one month to a date already on a Google Spreadsheet. In the example below I was trying to take the date from cell B2 (1/1/16) and add one month and ...
2
votes
1answer
411 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 ...
0
votes
0answers
54 views

How Can I Protect Specific (More Than One) Ranges

I have 13 Spreadsheets sharing different people and every day i copy(or editors copy)from before day's sheet and the spreadsheet has lots of formula so i try to lock them for no one mess them but it ...
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
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?
0
votes
1answer
55 views

Why doesn't my onEdit Function behave the same as my onFormSubmit

With the excellent help of this site I was able to get my onFormSubmit working. However I need the same thing to happen on another sheet only it has to happen after a cell has been assigned one of two ...
1
vote
1answer
25 views

Google Apps Script E-Mailing Stale Data

I have a Google Apps Script that, onFormSubmit, copies a template spreadsheet and populates it with values from the form. It then takes the new spreadsheet, converts it to PDF and e-mails it (as a ...
0
votes
1answer
39 views

How do I pass a range on another sheet within the spreadsheet file to a custom function?

I know how to pass simple ranges to a custom function (ranges in the same sheet as the function usage). How can I pass the address of a cell in a different sheet to that function. For example A1 has ...
2
votes
1answer
62 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
175 views

“Incorrect range height” error in Google script when using setValues

I am trying to convert calendar dates to fiscal dates. I've been successfully able to do all that. My problem is trying to write the fiscal date values back into the spreadsheet. Here is the code: ...
5
votes
1answer
66 views

Test Google Spreadsheets Add-On with custom functions

I have set up a Google Apps Scripts project with the intent of creating a Google Spreadsheets add-on with custom functions. However, when I use the option "Test as add-on", I can't use the functions ...
2
votes
1answer
85 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
2answers
226 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 ...
9
votes
1answer
355 views

Google Sheets - Script to change individual text color within a cell

I have a Google spreadsheet with hundreds of employee names for a schedule. Each cell has multiple names within that cell that look like this: First Last First Last First Last First Last First Last ...
2
votes
1answer
44 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 ...
3
votes
2answers
268 views

Ways to learn google apps script language? [closed]

I've been looking for a good way to automate my google docs and sheets on drive, buy haven't found specific answers or even general ones I can modify to work for my specific requirements. I'm doing ...
5
votes
1answer
288 views

In Google Sheets how do I duplicate a sheet along with its permission

In a Google Spreadsheet called Attendance there is a sheet called Template. The user duplicates this sheet, renames the sheet with current date and uses this sheet to mark attendance for students. The ...
3
votes
1answer
62 views

Can't find script insert option in Google Sheets

I want to add a script to Google Sheets. I watched a tutorial where to add a script one has to follow the path Insert>Script. But I found that there is no script option there. How can I get the ...
1
vote
0answers
17 views

dropdown script https://drive.google.com/open?id=1623xEoNJABNoqBhT4MhynWpiSsVBjuLylt5rPW9af1o [duplicate]

I have a script to populate a dropdown list based on a selection of another cell's dropdown list. E.g., if user does not make a choice from D9 dropdown menu, therefore F9 dropdown is Blank but has ...
2
votes
1answer
79 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
150 views

Dropdown list based on the result of another cell's dropdown

I want to populate a dropdown list based on a selection of another cell's dropdown list. Here is my spreadsheet. E.g., if user does not make a choice from D20 dropdown menu, therefore F20 dropdown is ...
2
votes
0answers
71 views

Google URL shortener rate limit exceeded on first request

I'm using the Google URL shortener service in Apps scripts to shorten very long Google Docs links when sending automated emails to our team. While building the script I ended up using 315 requests out ...
2
votes
0answers
40 views

Run two timestamps for time in/out in one Google Sheets [closed]

I have this code: function function1(event) { var timezone = "GMT-8"; var timestamp_format = "hh:mm:ss a"; var updateColName = "Agent"; var timeStampColName = "Start Time"; var sheet = ...
3
votes
1answer
63 views

Google Script Active Cell Validation

A Google Script I am writing that seems to be failing. The first part of this script is to validate that only a specific sheet is being changed. In this case column 3 of my sheet called ...
2
votes
1answer
41 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 ...
1
vote
1answer
347 views

Is there a way to generate edit response url for google form

I have a Google Form With a Google spreadsheet to store responses. In my spread sheet I have 4 column: name, email, revenue, and a fourth column Id which is used to identify the particular recipient. ...
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 ...
3
votes
1answer
167 views

Send selected cells from a row via email

I am starting with Google Scripts and I was hoping to create a sheet that could email selected cells from a row. What I want to do by selecting Send Email at the end of a row it then selects pre ...
1
vote
1answer
68 views

“sort” function results in all of my data going to the bottom of the 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. I would like to be able to have any staff member add jobs that need to be ...
3
votes
0answers
59 views

Create button “Add” to add a new row in sheets [duplicate]

I'd like to know how to add a new row copying all formulas from previous row .. What I'm looking for is as follows SR. NO ITEM CODE DESCRIPTION UNIT COST 1 5463345 ...
3
votes
1answer
156 views

Hide/Show Multiple Groups of Columns in Google Sheets

I found a script (on this post: I need to hide/show a group of columns in Google Sheets in a simple way ) that adds a dropdown menu with two options: Show Range X of Columns & Hide Range X of ...
1
vote
1answer
55 views

Change a working function from onOpen() to onEdit()

I currently have a working function that uses the onOpen() trigger to run. I am needing to make this an on edit instead of onOpen function so that a when a change is made in my master sheet, the child ...
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
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 ...
4
votes
1answer
47 views

Update column with last update of row in Google Sheets… except the header

I've been using this code to find the most recent update of a given row: function onEdit() { var s = SpreadsheetApp.getActiveSheet(); var r = s.getActiveCell(); if( r.getColumn() != 5 ) { ...
1
vote
1answer
191 views

How to copy related row data from Google Sheets remote tab or Sheet into current Sheet with a script?

I could use importRange, but I want to actually place the values themselves into the cells, instead. For sheets with many rows, a lot of importRange formulas can cause lag and slow down performance. ...
1
vote
1answer
41 views

Filtering a range by another range, custom function just says “internal error”

I'm trying to filter a range by comparing it to another range. I couldn't figure out a way to do this with functions in Google Spreadsheets so I made my own. function FilterByArray(range, ...
2
votes
2answers
80 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 ...
3
votes
1answer
89 views

How to auto-update function based on background color

I've been referencing @w0lf's answer to help me calculate the sum of cells based on their background color in Google Sheets. From the comments and some other research it appears that changing the ...
1
vote
1answer
58 views

Utilizing noreply option on Google Script SendEmail function

I have a script that takes data from an existing data table and sends it out to a distro list. A quick snippet of the code I'm using is: var emailDelivery = templateSheet.getRange("C2").getValue(); ...
1
vote
1answer
19 views

Use the order of sheets in which they appear in a Google spreadsheet

Goal What I would like to accomplish is to have my aggregation-master-schedule-sheet (see context) put schedules in the same order that the sheets are. I.e. the left most sheet is 1st, the 2nd ...
1
vote
1answer
30 views

Send the argument of a custom function as an email

I am trying to send email via script in Google Spreadsheet. I know that the argument in this case cell B4 will be integer. In my cell is function =sendEmails(B4) and my script looks like this. ...