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)

0
votes
0answers
57 views

Adding add an option to context menu in Google Drive

I'd like to be able to add an option to the context menu that appears when I right-click on a file or folder in Google Drive. I would connect this to a Google Apps script that would recursively ...
1
vote
0answers
50 views

How can I get my set values and formulas to populate to a row of values received from a Google Form?

When I receive submissions from a form I am trying to find a way to include my formulas and set values in the same row as the information submitted by form. My form is only collecting 14 values but my ...
0
votes
0answers
19 views

capture & Log Range into new sheet on a weekly basis

I'm using =IMPORTHTML to import a set of values into a spreadsheet and I would like to have those values captured and stored in a different sheet once a week. I'm not all that familiar with scripts ...
4
votes
1answer
60 views

Save daily to my Gmail in Google Sheets

Right now what I have is this in a Google sheet for my company daily lunch program: function sendLunchPerkSummery() { var d = Date(); var file = ...
1
vote
0answers
98 views

Google Apps Gmail Dual Delivery with Outlook Sync

We are in the process of migrating three email accounts from a cPanel web-hosted server to Google Apps Gmail. With this, these users exclusively use POP3 to check their email using Microsoft Outlook ...
1
vote
1answer
370 views

How to pass multidimensional array to a custom function in Spreadsheets

I want to pass a multidimensional array to a custom function. I do it like this: =customFunction({{"a1v1"; "a1v2"};{"a2v1"; "a2v2"; "a2v3"};{"a3v1"}}) However I don't get the expected behaviour ...
0
votes
0answers
72 views

Trying to convert “=importhtml” to UrlFetchApp.js

I'm trying to replace my cell which is =importhtml into a .js for Google App Script. The current function in Google Sheets now is =importhtml("http://www.gurufocus.com/financials/"&'Raw ...
1
vote
0answers
92 views

onEdit Script to auto run Filter on a tab

I'm trying to find a script that will run in a particular way, see below: it runs on a specific tab in a spreadsheet needs to either re-run a filter that i have in place on the tab OR can filter out ...
2
votes
1answer
139 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 ...
0
votes
0answers
91 views

How can I get the response ID of the person opening the form in the onOpen function in Google Forms?

I am using the following code in hopes of getting the responseID for the user who is editing their previous response to a Google Form. The problem is that the ID appears to be related to the ...
0
votes
1answer
62 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(); ...
1
vote
1answer
70 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 ...
2
votes
1answer
232 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
0answers
148 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 ...
1
vote
2answers
169 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 ...
2
votes
1answer
153 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
0answers
181 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 ...
1
vote
1answer
29 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?
2
votes
3answers
122 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 ...
0
votes
1answer
93 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.
1
vote
0answers
116 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
110 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 ...
0
votes
1answer
70 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 ...
1
vote
1answer
175 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"). ...
0
votes
2answers
4k 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
0answers
54 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 ...
2
votes
0answers
99 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 ...
1
vote
2answers
155 views

How can I select a sheet with a variable-supplied suffix in a script?

Here is the code I'm attempting: var day=new Date().getDay()-1; var month=new Date().getMonth(); var sheet=ss.getSheetByName((/^.\s/+month+'/'+day)); I'm new to regex, but essentially I'm writing a ...
1
vote
2answers
81 views

Is it possible to prevent people from entering data into my Google Spreadsheet?

Is it possible that I fix the order of user's entries with a script? For example, the user must fill cell A1 first, only after that he can fill cell A2. Maybe my explanation is better with an ...
1
vote
1answer
52 views

Set Selection throughout all sheets

I have a spreadsheet with multiple sheets. I want them all to scroll in sync. For example if I scroll to J18 in Sheet1, all others sheets will have the cursor at J18 and same row/column at the top ...
2
votes
1answer
885 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 ...
1
vote
1answer
49 views

Add a sheet from a template

Is there a way to add a new sheet to a spreadsheet from a template? If I'm using a template for time, I'd like to add a new sheet from the same template every two weeks.
0
votes
1answer
114 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
2answers
2k 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 ...
1
vote
2answers
131 views

How can I merge into one cell, all the non-zero values in a row each concatenated with the column header?

I hope this example is clear. I have played with join and filter but can't get the Summary field to display as below: Row 1 is a list of subjects. Row 2 is a teacher's subject allocation ...
2
votes
1answer
53 views

Google Sheets Passing Range from separate sheet into custom function

I have the following custom function I've built to basically reproduce a needle haystack type of functionality function ListBy (Range, Range2, needle) { var holder = []; if(typeof Range != ...
1
vote
1answer
265 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 ...
2
votes
1answer
714 views

Prevent “invoked too many times per second” error in Google Apps Script

I have a Google spreadsheet consisting of different months on each tab. Every month, I add a new tab and another 50-75 rows. There are many tabs. There is a cell on each row which calls a custom ...
0
votes
0answers
102 views

Pull data from one sheet (has a locked cell) to another sheet (has a locked cell) every day automatically?

I have a dynamic Google spreadsheet to which I add one more sheet every day. I want to take the data from sheet1 cell D96 (a protect cell) to sheet2 cell D3 (a protect cell) every day. I found a ...
2
votes
1answer
79 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 ...
0
votes
0answers
75 views

Sort all sheets by column 1 in first sheet

I’m trying to sort or autosort an extensive Google spreadsheet with various codepending sheets. I have tried to use the sort function but that is to blunt to use in this case. I’m hoping to get some ...
0
votes
0answers
238 views

Google apps script for text documents: regexp replace to footnote / link

Using Google apps script, in a google text document (i.e. just a regular documenet), I would like to convert the following string { some text | footnote | link } to some text with a ...
1
vote
1answer
314 views

How do I use a variable to reference another variable in Google Apps Script?

I'm trying to create a loop that sets values of a set of variables, and I want to use the incremented loop variable to define which variable I'm setting the value of, like this: var box1, box2, box3, ...
2
votes
1answer
328 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 ...
3
votes
1answer
253 views

How can I create a Google Spreadsheet whose name and cells auto-complete with cells completed on another sheet?

I'm using Google Spreadsheets to manage projects, and I'm not familiar with scripts or macros (though I'd really like to learn how to use it, so if you have any good tutorials or tips, let me know). ...
3
votes
1answer
773 views

How Can I Solve Error “Exceeded maximum execution time” in Google Spreadsheet?

I found a script which I really need (link) but it gives an error (Exceeded maximum execution time) generally. How can I solve this error? This is the script: function getTotalSum(cell) { var ...
3
votes
1answer
170 views

Individual time stamps for individual sheets in a Google Spreadsheet containing multiple sheets

I am using the New Google Sheets, and I have created a "Master Document" that contains a multitude of sheets, with each expressing different kinds of data. I want a "Last modified" time stamp to ...
0
votes
0answers
107 views

How to create a simple dialog form in Google Spreadsheets with GAS

The functionality that I am going for is this: Click on a menu option Interactive box comes up with 6 textboxes that correspond with a label each In two of those boxes, at most three, a number is ...
1
vote
0answers
59 views

Google Apps Script with forms to check if a doc url is 'shared'

Does anyone know "IF" it is possible to use Google Apps Script with a Google form to auto check "IF" a document URL pasted into the form is a "shared" document? I'm a teacher and I use Google forms ...
2
votes
2answers
122 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 ...