Questions tagged [google-apps-script]

For questions about using Google Apps Script to extend Google applications

Filter by
Sorted by
Tagged with
2
votes
1answer
2k 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 ...
5
votes
2answers
6k views

How can I trigger a function when switching sheets within a spreadsheet?

How can I trigger a function when switching sheets? Let's say I'm viewing a multi-sheet spreadsheet. Now I want a function to run whenever I switch from one sheet (tab) to another. Is that possible? ...
3
votes
1answer
899 views

Is it possible to make a summary sheet in Google Docs based on tags?

I have a document in Google Docs. It is very long and I want to tag and extract only certain paragraphs into a second document that is a summary of the first document. I want to be able to dynamically ...
1
vote
2answers
1k views

“Select Users from organization” field with Google Forms?

I have a Google form that allows users to send a co-worker a digital greeting card but they have to manually enter the email address of the person they are sending it to. The issue is sometimes they ...
1
vote
2answers
7k views

Timestamp code for Google Sheets

I am using this script in order to put a time stamp in column B when someone edits in a row. However, I need it to place the time stamp if someone edits a row in column A. I don't need it to place a ...
3
votes
1answer
256 views

IMPORTRANGE as dependent function

I am trying to write a script which sets the function IMPORTRANGE in a specific cell, using as KEY the content of another cell. I have the list of the KEYs in Sheet2 and here is what I have so far: ...
0
votes
1answer
105 views

What is a cut and paste approach to converting a chunk of a google spreadsheet to markdown table?

I maintain my web site in a version of markdown, with the common table extension. I maintain my inventory as a google spreadsheet. I'd like a quick way to copy paste a chunk of a spreadsheet, and ...
0
votes
1answer
1k views

How to make this script for sending canned responses in Gmail to work?

The following script is supposed to use to send automatic response emails using Gmail's canned response feature while avoiding “+canned.response” added to the username in the reply: function ...
3
votes
1answer
8k views

Keep multiple sheets synchronised (both ways)

I need to have multiple Google Sheets be synced both ways. For example: I have a "master" sheet that has all of my information. And then I have multiple "filtered" sheets. Each filtered sheet only ...
8
votes
1answer
10k views

Detect whether a cell has strikethrough format

Is there a function that checks if the strikethrough format has been applied to the cell contents? I would like use a formula similar to (=IF(HAS_STRIKETHROUGH(C5), 1,0)
3
votes
1answer
9k views

How do I change a cell to the color of the hexadecimal value of a cell in Google Spreadsheets?

Based on my data, I calculated values of hexadecimal color codes. I want some cell (I don't care whether it's an empty cell at the end of the row or the same cell) to be the color based on the code. ...
3
votes
1answer
1k 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
855 views

What is the difference between creating a menu with .getUI().createMenu() and .addMenu()?

What is the difference between these two ways of getting the same thing (a new menu item)? Version 1 function onOpen(e) { SpreadsheetApp.getUi() .createMenu('My Menu') .addItem('My ...
3
votes
1answer
2k views

Script does not trigger on FormSubmit

I am trying to remove older duplicate form responses based on a column using the following code. The credit for the code goes to: http://www.jacorre.com/tutorial/remove-duplicate-rows-google-...
4
votes
2answers
7k views

How to select multiple, non-consecutive cells in Google Sheets using a list of the cell addresses

I have a very long, comma-separated list of cell address coordinates, shortened here for the sake of brevity: C3,C7,C17,C56. I would like to select these cells. Is this possible to do by pasting the ...
2
votes
1answer
1k views

Is there a way to automatically duplicate a large number of Google Sheets, name them, then copy their URLs to another sheet?

Background: For a genealogy project, I've created a Google sheet where participants enter all details of one ancestor. (FILEXXXX) In another Google sheet (not just another tab/sheet, another FILE) ...
0
votes
0answers
996 views

Script to create an edit response URL in Google Sheet sometimes fails

I have been using the "FormMule" addon to create "Form Edit URL" apart from mail merge. However, the triggers for the addon seemed to have stopped working. I found this post answered by Rubén: Show ...
3
votes
2answers
1k views

How to restrict a Google Script to a certain cell range?

I'm working in an automatic script that shows the last modified dates of some cells within a sheet. So far, I've succeed with the sheet restriction adding an if condition, but I want to restrict this ...
1
vote
0answers
3k views

Auomatically lock/protect a range or row based on date

Any one can help how to do a scripts for auto lock / protect range/row by date I have try but this script only lock a cell only ( cell M:M ) a = SpreadsheetApp.getActiveSpreadsheet(); var s = a....
1
vote
1answer
362 views

Export “To:” email addresses from Gmail

I found a similar question here: Get e-mail addresses from Gmail messages received but the difference is that I want "To:" addresses, not "From:". I have a catch-all email address at my domain. ...
2
votes
1answer
1k 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
684 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 ...
1
vote
1answer
7k views

Google script match values from a column in one sheet to a column in another sheet

I'm trying to filter two columns in Google Spreadsheets, say A in sheet 1 (which contains work order numbers) and A in sheet 2 (which contains the same strings of work order numbers but they are ...
4
votes
1answer
7k 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 ...
1
vote
1answer
760 views

Trouble renaming a pdf file created in Apps script

I used Google Forms to make a 20-question quiz and added a page to the response spreadsheet that automatically grades the quiz immediately after it's submitted. I have this script in place to ...
2
votes
1answer
651 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 four new sheets (within the current sheet I'm in) with the following formatting in each: 1st row frozen with column headings on ...
1
vote
1answer
2k views

Find in range and go to cell. Trigger On form submit not working!

I am using a script that checks column range B2:B for a specific value contained in a cell of another column (the value in this cell deliberately corresponds to the last value in the column B) and ...
2
votes
1answer
2k 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 ...
-1
votes
1answer
203 views

Your Time stamp code

I have copied and pasted your code to put a time stamp on a spreadsheet that I am working on and it is working great. Except the day is coming back as "56" for some reason and I don't know why. It ...
3
votes
2answers
1k views

How can I automatically set “sheets last updated” in a cell on Google Docs Spreadsheets?

Simple task!.. output a date and time every time something in the sheet is edited! function onEdit() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets("Data"); var ...
3
votes
1answer
2k 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 ...
6
votes
3answers
9k views

Can I set the number format to show exactly 2 decimals only when needed in Google Spreadsheet?

I want to set the number format as below: If the number have more than 2 decimals, round it to 2 only (e.g. 12.3456 -> 12.35). If the number is whole number, just let it be (e.g. 12 -> 12).
1
vote
1answer
5k views

Google Apps Script Exceeded maximum execution time

My code for an API pull has been timing out a lot lately. Here is my code (note that I have changed some variables for privacy): // SHEET DATA var ss = SpreadsheetApp.getActive(); var data_sheet = ...
4
votes
1answer
745 views

Using Google Apps to handle customized after hours auto responses to support based email inbox

THE SETUP: Our company has a primary support email that all of our clients use to generate helpdesk tickets. It is a google apps inbox using helpdesk@%our primary domain% Our ticketing support auto ...
6
votes
1answer
552 views

Probability Density Function of a Chi Distribution

I'm trying to write an extension for Google Sheets to add the CHIDIST() function as in Microsoft Excel and LibreOffice Calc. My current attempt does not produce the same results as the LibreOffice ...
2
votes
2answers
572 views

Truncating the Title in the HYPERLINK function in Google Spreadsheet

I have a number of URLs that I first convert from text to the HYPERLINK function and then want to edit the title-section of this function, so that only the domain is visible in the cells. I attached ...
-2
votes
1answer
802 views

Lock a column based on the date

I have an Employee attendance register in Google Sheets, wherein I want to lock the particular column/s after the date is passed over. This feature is required for the clerk to enter the date on the ...
2
votes
1answer
1k 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() { ...
17
votes
3answers
50k views

Extract the link text and URL from a hyperlinked cell

Suppose I have a hyperlink in cell A1: =hyperlink("stackexchange.com", "Stack Exchange") Elsewhere in the sheet, I'd like to have formulas that get the link text and URL from A1, separately. I found ...
11
votes
1answer
31k views

Show URL used to edit responses from a Google Form in a Google Spreadsheet by using a script

I'm trying to make the edit URL for a Google Form automatically populate in the response Google Sheet that it's attached to. I've seen this already and want to use it, but I'm having issues trying to ...
3
votes
1answer
1k views

Timestamp in two columns

As a teacher, I am trying to create a Google sheet for the students to use as they sign in and out of class. I have successfully used code to auto insert a time stamp into column A if Column C is ...
0
votes
1answer
1k views

Can I cut and paste projects from a Google sheet using a script?

I want an automated method of cutting and pasting completed projects from one sheet to another sheet. I want to have a column where users can go in and type "DONE" at the end of a row to state that ...
1
vote
1answer
293 views

Remove any sheets not listed in an array

I have a Google App Script that has 6 sheets. onOpen, I would like to see if the user created any additional sheets, and if so, delete them. So far, I have: function onOpen(){ var ...
1
vote
0answers
73 views

Slow add-on: ~13k named ranges in empty document

I've created Google Apps Script for Google Documents which uses NamedRange for keeping track of the text inserted by the script. The script is bound to the Document, because I use methods, which would ...
4
votes
1answer
2k views

IMPORTHTML at a certain time of day in Google Spreadsheets

I am looking for a way to import the table from this formula once per day at a certain time instead of automatically updating as the formulas seems to do. I need to do this in order to track certain ...
4
votes
1answer
4k views

Copying data to *and from* another sheet based on the month of a date

This is a follow-up to Copying data to another sheet based on the month of a date, with a different requirement: instead of one-way data transfer (from Master sheet to others), two-directional ...
1
vote
1answer
1k views

Getting values from other sheets with a custom function

I've defined the following function, and use it in sheet1: function myfcn (sheetname,rowstart,rows,columnstart,rows){ var sheet= SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetname); ...
1
vote
1answer
2k 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
3k 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
6k 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 < ...

1
17 18
19
20 21
27