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)

3
votes
1answer
490 views

Looping through the range of cells to test the dates

I am trying to create a function to check the dates in 'Dt' sheet and return Match or Not Match. It works fine with when I display my answer in MsgBox, but when I try to do it in one of the ...
2
votes
1answer
475 views

Automatically create a new row each day, on top of older rows

I am looking for a way to automatically create a new row on top of older rows each day. Inside of this row should be the current date.
0
votes
1answer
209 views

Google spreadsheet multiple auto-sorting

In a Google Spreadsheet I have different group of cells to auto-sort ascending i.e. table range a3:c16 columntosortby = 2 table range d18:f31 columntosortby = 5 table range g33:i46 columntosortby = ...
0
votes
2answers
1k views

Create a dropdown list of options from VLOOKUP

What I'd like to do is get a dropdown list of options from a VLOOKUP type function where I can select the value for the next lookup. Example Here the data I'm using for reference. Notice "AAA" ...
1
vote
1answer
140 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
3answers
4k views

Google Scripts : How to distinguish Empty cells from Zero

I want to count a number of specific responses from a form where the response can be left empty, zero or any other number 'd'. The following code: var data = sheet.getRange("B2:L").getValues(); ...
2
votes
1answer
693 views

If cell equals a value then move row to different Google Spreadsheet

I've got a script that sorts a Google Spreadsheet when a value in a column is changed. I'd like to add to the script the following functionality: If the value for column E = "Complete" then the ...
0
votes
1answer
31 views

Sum cells according to cell colour

I want to sum cells only with a specific cell colour. I'm using this code: function sumWhereBackgroundColorIs(color, rangeSpecification) { var sheet = SpreadsheetApp.getActiveSpreadsheet(); ...
0
votes
1answer
155 views

Time Triggered Script to Change Cell Contents

What I want to do is for example: A time will be manually entered into a cell say D3, when it is 20 minutes before this I want cell D1 to change to "20 MIN", WHEN IT IS 5 minutes before I want to ...
0
votes
1answer
901 views

Script error trying to populate form drop down menu from spreadsheet

We are trying to link a list on a Google Spreadsheet to a drop down menu on a Google Form. The twist is that this Google Spreadsheet list will be continuously updated and needs to automatically ...
1
vote
1answer
107 views

How to send cell as argument for function?

I am trying to write a custom function for Google spreadsheets that checks the formatting of a given cell and acts accordingly. I know that I can give a string as argument and get it to work but then ...
0
votes
1answer
38 views

Script that adds new row to multiple sheets in Google Spreadsheets

I want to add a script in Google Spreadsheets that adds new row on the second line of every sheet within a Google Spreadsheet that contains multiple spreadsheets. This will need to happen every day.
3
votes
1answer
266 views

Can a Google Spreadsheet be recalculated if it's not manually opened?

We have some Google Spreadsheets that use the ImportHtml() to pull in some real messy tables. Then on on an alternate page we access the above data and pull it into a nice cleanly formatted table via ...
1
vote
1answer
16 views

Script to only show timestamp when a specific column is changed?

I want to take an existing script from a Google Spreadsheets and change it so it only updates the last column when I make a change to a specific column in the last row. I can't get it to only key off ...
0
votes
2answers
596 views

Show data from one sheet on another if date is today

I have a list of people responsible for data verification that are changing every day. The schedule is on one sheet. And data verification is on another. What I need is to show only responsible ...
0
votes
2answers
47 views

Automating Predictable Received Gmail Attachments

BACKGROUND: I work in a small construction business. On a regular basis, I get emailed time sheets that I use to attach to / write invoices with. Would it be possible to Send an automatic received ...
1
vote
1answer
1k 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 ...
6
votes
2answers
3k views

Pass range in Google Apps script custom function without using A1 notation

I'm new to Google Apps script and I would like to create a function for a spreadsheet that sums cell values when the cells meet certain criteria, such as the background color. Moreover, I'd like to ...
2
votes
2answers
2k views

Is it possible to pull my Company directory into Google sites intranet?

We use Google apps for enterprise, and I want to build an intranet, based on the Google sites intranet template In the Directory area, I want that the list will be updated from my contact/company ...
2
votes
0answers
42 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. ...
0
votes
1answer
455 views

How can I record the date/time when a new row is added?

I want to add a date value when a new row is added in Google spreadsheet. I have seen the script on Add a 'creation date' value when a new line is edited, but I was not able to modify the code to my ...
2
votes
2answers
451 views

Viewing all group contacts information in one page

Say I have 5 contacts in a group. I would like to see all their details in one page (/view), preferably separated by an horizontal line between every contact. Is something like this possible?
2
votes
1answer
63 views

Return name of range as string in Google Spreadsheets

I have a range that is named apple in Google Spreadsheets. I thought a method like getRangeName("apple") would exist. I want to get the names of many ranges and set them as the header for the columns ...
1
vote
1answer
633 views

Send an email with attachment using Google Apps Script

I have a Google Spreadsheet with a list of emails. I want to build a routine that send email automatically to those email addresses. I also want to attach a PDF to this email. The PDF file is located ...
2
votes
2answers
2k 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 ...
0
votes
1answer
280 views

How to format the date in this Google Docs script

I've come across this rank checking script. I'm not sure exactly where I found it but it's built on Google Docs and a script which automates the rank checking process. I understand a bit of coding ...
1
vote
1answer
182 views

Create help pop-up in Google Document using Google Apps Script

I am trying to create a Google Document that has complex questions we ask clients. I want to add a link at the end of each question that will launch a pop-up for additional information. I currently ...
2
votes
2answers
603 views

Is there a way to add a row to a Google Spreadsheet via a script?

I'd like to be able to call a script, which will add a row to a Google Spreadsheet, and manage stuff like user login. For example, gdocs_addrow --id <doc-id> name="John Doe" age="31" I know ...
3
votes
3answers
3k views

How can I make some data Autosort in a spreadsheet on edit?

I am working with a simple spreadsheet that has name/lastnames in it. I need for the spreadsheet to automatically sort the entry alphabetically by the last name (column B). I have used the following ...
2
votes
0answers
55 views

Batch Hiding Function in Google Script

I wrote a function that iterates through every non-blank row in the sheet, checks the value of a certain cell, and then if that cell matches my criteria its row number is added to an array. I then ...
6
votes
2answers
3k views

Colorize a cell in Google Spreadsheets based on cell data

I'd like to colorize a cell based on it's contents. 0 = red, 100 = green, and linearly interpolated between. function LinInt(x){ var ss = SpreadsheetApp.getActiveSheet(); var cell = ...
2
votes
3answers
89 views

Code invoked too many times

My goal is pretty simple: take the value in column U and check if it's within particular ranges. If it's 1–100, put a 1 in column A. If it's 101–200, put a 2 in column A. The problem is, I have almost ...
6
votes
2answers
6k views

How to Refresh a cell in Google Spreadsheet?

I have a column in Google Spreadsheet that calls an outside webservice using URLFetch in a Google Script. The cell uses two parameters in that cell's row. After a change occurs where those two ...
2
votes
1answer
63 views

Run script when clicked on picture in published Google spreadsheet?

I used the script underneath in Google Spreadsheet and added an image that when clicked upon runs the GOTOSHEETONE function to navigate to sheet: SHEETONE. So far so good. However, when I publish my ...
1
vote
2answers
1k views

Can I copy row from one Google Spreadsheet to another based on certain criteria

I have a spreadsheet to track student loan outs: Column A is the student name Column B is how many loan outs they have received Column C is the class period Column D is the teacher name ...
1
vote
0answers
104 views

Can I fill specific cells in my spreadsheet when submitting a Google Form?

I have a Google Spreadsheet that contains a list of dates, and empty cells. For a variety of reasons, I'd like to be able to have people add fill out a Google Form where they select a date, and fill ...
0
votes
1answer
24 views

Add contacts to all new addresses

Is it possible to automatically add contacts to new GMail accounts created under your Google apps account? If so, how can I achieve such a thing?
0
votes
1answer
84 views

Google FormsApp: Change item based on answer

Is it possible to change item, in my case - checkbox, based on user answer? For example, I have Date item, where user have to put his/her birthday, and then if user is born on 2001 or later, then add ...
1
vote
0answers
107 views

Entering time data quickly using code for a specific range of cells

What API code do I use if I want to quickly enter 24 hour times (without entering the colon and still retaining time formatting) for a certain range of cells? I know the following code works for ...
1
vote
0answers
34 views

Send email from Google Spreadsheet to adress in column

From an existing Google Spreadsheet; every time a value is added in column M(x), I would like to send an email with a specified text to the address listed in column F(x) from the same row x. Which ...
1
vote
0answers
65 views

Trello API: How to remove a member from an organization using Google Apps Script (GAS)

In a Google Spreadsheet, I have a list of Trello usernames that I want to remove from my Trello organization. How can I use the Trello API to remove all these members from my organization? I found ...
1
vote
2answers
84 views

Gmail message details stored to spreadsheet

I would like to know if there is a way that I could have specific messages in my email to go directly in a Google spreadsheet. For example I need all email messages with subject line of "X" be stored ...
2
votes
1answer
873 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, ...
0
votes
1answer
30 views

How do I sort several columns by a list of values?

In Google Sheets, I have several columns: Industry | Company | Country | Date Last Visited And I want to order them by Country, then by Date Last Visited, then by Industry, then by Company so that ...
0
votes
0answers
289 views

Prefilled Google Forms with Google Spreadsheet Data

I'm looking for a way to 'pre-fill' a Google Form with specific data from a Google Spreadsheet. The form will have the same 'standard' questions for everyone, but the data in the first two question ...
12
votes
4answers
3k views

Is there any way to script a Google Docs spreadsheet?

I have a really complex spreadsheet in Google Docs, and while it works, having the ability to script it a bit (à la VBA in Microsoft Office) would make it a lot cleaner. I heard that this is doable in ...
1
vote
1answer
55 views

What's wrong with this Google Apps Script code?

Forewarning: I'm a noob at JavaScript, with varying experience and less knowledge. I don't get why this code fails with TypeError: can't call method "getSheetName"/undefined. (line 7, file "Koodi"). ...
23
votes
6answers
36k views

Alternating colors for lines in Google docs spreadsheet

I have a shared Google spreadsheet where several users have already filled out parts. It would be useful to have alternately colored lines to facilitate correct placement of additional data. Is ...
2
votes
0answers
59 views

How to Modify Matched Cells Across Multiple Sheets with Google Script

My question is a fairly complex one, but I'll do my best to clarify exactly what I'd like to do and this requires some background: I have a Google Spreadsheet used for user administration in my ...
3
votes
1answer
547 views

How to export / import a Google Apps Script as a file into a new spreadsheet?

I fear this may have an obvious answer, but I've been knocking my head over this and can't find it! When creating a new spreadsheet, we can easily create a script within it. I like to call it a ...