Questions tagged [google-apps-script]

For questions about using Google Apps Script to extend Google applications

Filter by
Sorted by
Tagged with
6
votes
2answers
59k views

Create a popup in Google Spreadsheet

How can I create a popup in Google Sheets using script editor? I'd like to show a popup with a personalised notification. It should start like this: function onOpen() { var ss = SpreadsheetApp....
2
votes
1answer
592 views

Is there a script to stamp & password protect a PDF on Google Drive?

I have a few PDFs on a Google Drive, I would like to watermark/stamp & password protect (to disallow editing) before I share them. Is there a solution using Google App Scripts?
2
votes
2answers
141 views

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

I need a number to be converted to a name. In B1:B1000 I have numbers. In C1:C1000 I has function name. On writing C30 got an error: invoked too many times per second ... how do I do function on range ...
1
vote
2answers
555 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 ...
3
votes
2answers
26k 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
3answers
4k views

Sort randomly in a Google Script

I found this script to sort a Google Spreadsheet but I need to sort everything randomly instead of alphabetically, is there a way to sort it randomly every time this script runs? // LinkBack to this ...
2
votes
1answer
1k 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 = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(...
1
vote
0answers
1k views

Google Script: setValue function on form submit

I have written the following code function myFunction(e){ var options={cc: 'x@abc.com'}; MailApp.sendEmail(e.values[2], "New SMS Blast request", "A new SMS blast request has been entered, the ...
2
votes
1answer
865 views

substitute() multiple terms in Google Spreadsheets

I'm trying to simplify semi-complex text strings into much simpler ones - specifically names into hashtags. For example: Tomáš Rosický into #TomasRosicky or Alex Oxlade-Chamberlain into #...
1
vote
2answers
1k views

Google Sheets permissions

I built two separate spreadsheets in Google Drive and spreadsheet "A" has a script that when run, will copy the input data into spreadsheet "B". When I test it, it works perfectly. But I have other ...
4
votes
1answer
2k views

How to access a gauge chart in Google Spreadsheets?

I have a gauge chart in my spreadsheet. I am looking for a line for accessing it. function myFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Gauge"); ...
5
votes
1answer
5k views

Send email with an attachment located in Google Drive

I want to send a PDF attachment located on Google Drive from a Sheet. Code I'm using is: function sendEmails() { var sheet = SpreadsheetApp.getActiveSheet(); var startRow = 2; // First row of ...
1
vote
1answer
3k views

Trying to send email from Google Sheets with image attachment

I'm trying to send an email from within Google Sheets and then format it via some joins to send to an address for my Blogger account. I need to attach the image file apparently as the image isn't ...
6
votes
4answers
23k views

How to make Google Sheets jump to today's row when opened?

I have a sheet that has many rows to put data. Since there are too many rows, I want to have the cursor jump to a particular row when the sheet is opened. Edit not from OP: "The date column has the ...
1
vote
1answer
734 views

Triggering timestamp on formula input

I'd like to have a timestamp which triggers its input depending on a cell containing a formula like =IF(ISBLANK(cell),"", time ), and not upon manual input. My script is the following and is working ...
3
votes
1answer
2k views

Auto sort data but by sheet not range

I found this script from How can I apply a script to only one specific sheet within a spreadsheet to auto sort a column: function onEdit(){ var sh0 = SpreadsheetApp.getActiveSpreadsheet()....
3
votes
1answer
1k views

Google Spreadsheet Timestamp on Edit?

I got the major part of answer on this link: Google Spreadsheet Timestamp? The code on this link is below: function onEdit() { var s = SpreadsheetApp.getActiveSheet(); if( s.getName() == "Sheet1" ...
12
votes
1answer
6k views

How to create user-defined key bindings or shortcuts to run App Scripts in Google Docs

This question specifically applies to Google Documents, not Google Spreadsheets (but if the answer applies to both, all the better). Google Documents has built-in Keyboard shortcuts for Google Docs. ...
4
votes
1answer
1k views

How to calculate a date in Google Documents

I can calculate a date countdown pretty easily in sheets with a formula like this: =MINUS(DATE(2015,5,25),TODAY()) Is there any way to add a date countdown in a Google Document? If not, how about ...
2
votes
1answer
3k views

Importing columns across two Google Sheets in same spreadsheet

I have one spreadsheet which houses the database of my members. In the same spreadsheet, I have another sheet where I will track attendance for the events for each of these members. First issue: Now,...
3
votes
1answer
6k views

Trigger Script in Spreadsheet in Similar Fashion to a Link

I currently have a button on my spreadsheet (a text box image that triggers the script). Unfortunately this button doesn't work when using a tablet. Is there a way of triggering a script to run via a ...
4
votes
1answer
4k views

Custom script “invoked too many times” error

Credit: Google Spreadsheets function to find distance between cities function getDirection(city1, city2, unit) { var directions = Maps.newDirectionFinder() .setOrigin(city1).setDestination(...
1
vote
1answer
157 views

Script to Create Copy (Backup) of entire spreadsheet onOpen

Is it possible to write a script or is there another method of backing up a spreadsheet when opened? The reason is: I have other users opening my spreadsheets and if they completely stuff everything ...
4
votes
1answer
7k views

Script to create a new worksheet in Google Spreadsheet

I want to be able to have a button on a Google Spreadsheet. The user clicks on the button and a new worksheet is created based on a template (or blank existing worksheet). The new worksheet should ...
3
votes
3answers
6k 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 https://webapps.stackexchange.com/a/50149/88163....
1
vote
1answer
27 views

Custom highlighting style on Google Spreadsheet

I am new to Google spreadsheet and I'm wondering if there are any other ways to draw attention to a box rather than just change its colour. I want to emphasize a box drawing a circle on it. I saw ...
3
votes
1answer
712 views

I created a button in a panel (dialogue window), when I push the button I'd like to appear a new panel (dialogue) window

I created a button in Google Spreadsheet. When I push the button a custom window appears. In that window I have two buttons, one to close and one to see a new window. Everything goes well except the ...
4
votes
1answer
485 views

Can I use Google Chart Gallery in Google Spreadsheets?

Google Spreadsheets has column charts but I want to use "draw Annotations" like this (Annotations). Column chart doesn't show bar value as "draw Annotations" on top. My chart included these: First ...
3
votes
1answer
360 views

How to sort Google Sheets columns by row height

I'm working on a sheet that involves multiple columns corresponding to various data. Each column has a varying number of cells of varying heights with wrapped text. What I want to do is make the sheet ...
1
vote
1answer
981 views

How to place invisible placeholders in a Google Doc?

I'd like to put invisible placeholders in a Google Doc so that they can be found and the content changed. In HTML, this would be a <span id="name-of-placeholder">, with the item findable via "elem =...
4
votes
1answer
8k views

Generate a formatted Google document from spreadsheet

As the title says, I have data (Q & A grouped by subject) that I have to export to a document file. As shown above, the source data on the left should be formatted like the example on the right ...
9
votes
4answers
32k views

How to limit the length of data in a cell in Google Sheets?

Is it possible to put a limit to the length of cell content while entering data into a cell using Google Apps Script or any other way?
1
vote
1answer
2k views

How to add line breaks in a cell before specific keywords in Google Sheets

I'm new to Google Sheets and wondering how to tell GS to insert line breaks in a cell with text if there are some one or two letter before the text. For instance, I have a cell like this: I want to ...
1
vote
1answer
671 views

Change an input value in a cell to another value depending on what the input was

What I would like to do is change a number input in the rating column (G3:G9001) to the corresponding number of stars (from 1-10). However I could not figure out how to do this. As a test I tried to ...
2
votes
1answer
3k views

Create a function to copy range (values only) to a new tab at specified intervals

Looking to find a function that can copy the values only from a range I am importing from the web at a certain time. Have found a lot of functions that are similar to what I need but can't nail one ...
2
votes
1answer
1k views

Using Google Apps Script to set cursor to Headers in Google Docs

I am trying to create a Google Apps Script that could help navigate through the headers. I have currently a code searching the position with the function "findText" that I used in a custom menu in my ...
1
vote
1answer
154 views

Conditionally change sign of decimal value in cell for each row

Here's a preview of the spreadsheet I'm editing in Google Drive: The transaction type cell has a value of "debit" if the row is for an expense, and "credit" if it is income. I would like a script to ...
1
vote
1answer
851 views

Mail merge, send as an Alias

I was working with a Google spreadsheet with a script associated with it to do mail merge via Google Apps for Education. The spreadsheet works fine, although my user wanted to be able to send from her ...
1
vote
0answers
1k views

Gmail Auto-Response, one time only

I want to set up auto-reply emails using scripts. We're currently using Canned Responses but the emails we're responding to just changed their setup so instead of sending the reply to the sender, we ...
1
vote
0answers
85 views

How to add pictures to shared contacts in google contacts?

More specifically: is there a way to add a picture to external shared contacts in Google Apps for Enterprise, where the picture is shared amongst all members of my domain? I know it is possible to ...
2
votes
1answer
561 views

Creating multiple timestamps on Google Sheets to make dependent drop-down boxes work

I need timestamps on two different sheets to make two different dependent drop boxes work. I use the scripts below but can only get one sheet to work and not both sheets: Script time in function ...
3
votes
2answers
1k views

How do you subtract two time values in military format in Google Apps Scripts for a spreadsheet?

One column is labeled Checkin Time and the other is labeled Checkout Time and finally I have a column that is labeled Total Time Worked. The cells in the Total Time worked column should subtract the ...
3
votes
1answer
154 views

Jagged array from Google Spreadsheet range

The range in my Google Spreadsheet looks like this: | A | B | C | D | E | F | |-------------------|-----|-------------------|-----|-----------------...
1
vote
1answer
2k views

How to get the Position of a paragraph in google docs API

Using GAS, I'm trying to navigate paragraphs in a google doc and record their starting position so that I can display an interactive navigation menu in a sidebar. But I can't find any GAS method that ...
1
vote
1answer
1k views

How do I put the timestamp in the “check in” or “check out” column based on the user's response in the Google form?

I created a Google form that allows users to clock in/out. The form asks two questions: their pin number and whether they want to check in or out. When the user clicks on "check in" and submits, the ...
1
vote
1answer
1k views

Reference an entire sheet in Google Sheets [duplicate]

Is there a way to reference an entire spreadsheet with a cell reference in Google Sheets? Say I wanted to find out how many cells in Sheet1 were non empty. In sheet two I'd want to do something like ...
0
votes
1answer
240 views

Unable to import pricing info from toysrus.com into a Google Spreadsheet

I'm trying to pull live pricing from a given toysrus.com item into a Google Spreadsheet (one item/price per row), and am having no luck whatsoever. Importxml(url, xpath) does not work (similar to the ...
2
votes
1answer
2k views

Add timestamp to two different columns in Google Spreadsheets

Need help in adding another function using the below script. I would like to have a timestamp "start" and "end" on two different columns, whenever the other two separate columns are edited. Based on ...
3
votes
1answer
5k views

Unique ID Column

I have a Google Spreadsheet that I want to have a unique number created in column A when I enter information in column B. Below is the formula I currently have that works, but I am wondering if there ...
2
votes
1answer
2k views

How do I loop a script through all pages but the first one?

I'm very new to all this. I'm trying to write a script that sorts sheets by descending date order each time a new row is entered. I need the script to run on all pages but the first (the summary page)....

1 19 20 21 22 23 27