Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [google-apps-script]

For questions about using Google Apps Script to extend Google applications

3
votes
0answers
2k views

Set title of currently selected chart from named cell

There's a sample over here that will show how to set the first's chart title to the active cell: function onOpen(){ SpreadsheetApp.getUi().createMenu('Charts').addItem('Update title of the first ...
2
votes
0answers
59 views

How to automatically create a templated Google sheet?

I'm trying to figure out how to automatically create a templated Google sheets worksheet when a new entry is made in a different sheet. So the flow would be: Person's name is added into Google sheet ...
2
votes
0answers
2k 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....
2
votes
0answers
2k views

Google sheets query returns “loading…”

I've put together a web application that relies on a series of Google components. Google Forms collects data from users Google sheets saves the data (automatically) Additional "calculated" columns ...
1
vote
0answers
32 views

Internal Error when trying to share Google Apps Script

I'm the owner of a Google Apps Script project that contains several scripts. When I try to give Edit permissions to people in my organization, it throws an error: Error Sorry, an internal ...
1
vote
0answers
21 views

How to pass a parameter allow= “geolocation” when embedding Google Apps Script in a Google site?

The target is to embed a Google Apps Script gadget into my Google site. The function of this script is to show a google map, determin the location of the client and center the map to the found ...
1
vote
0answers
23 views

How to combine an auto response with forwarding in my Gmail account?

I am trying to find a way to figure out how to combine an auto response with forwarding in my Gmail account. Essentially, I want to receive a message, add a canned response and then resend the new ...
1
vote
0answers
16 views

How to Get Data from Multiple Cells and Combine into a Comment in another cell

I have a spreadsheet of orders (rows) that has room for 70 products (columns). I would like for a script to find every cell that has a value (0's are blank) and then write that value (this is the qty ...
1
vote
0answers
14 views

Horizontal Scrolling Loop Macro for Google Sheets

I am looking to see if it’s possible to have a macro that would scroll a Google sheet to the end at a certain speed, and then once at the end, jump to the beginning and begin again. We are trying to ...
1
vote
0answers
17 views

getUi.prompt - How to enable confirmation with “Enter” key

When using SpreadsheetApp.getUi().prompt();, how do I allow the user to simply press Enter to confirm their entry instead of having to click on OK?
1
vote
0answers
246 views

Duplicate sheet but keep protected range with exact same user as only editor?

The following code duplicates a sheet based on a template, and copies over the protected range permissions from the template sheet to the new sheet. However, the permission range is now there in the ...
1
vote
0answers
110 views

Google Apps Script - how to hide run message

I have a question about running apps script on a Google Sheet. I have a few scripts written that can apply a filter and remove a filter. When I run the script from the button on the spreadsheet the ...
1
vote
0answers
107 views

Sync Google Spreadsheet to Google Calendar (remove any duplicates)

I'm trying to sync my Google sheet to my Google Calendar. However, I keep running into errors. I've tried a myriad of scripts, but none seem to work. I got one to work, but every time I ran the script,...
1
vote
0answers
18 views

Script to place duplicate Google sheet beside the sheet it copies (instead of the end)

Is there any way to modify my script to have the sheet it's copying insert the new sheet immediately to the right of the one it's copying? I have tons of tabs in the file, and it's starting to get ...
1
vote
0answers
334 views

Adding multiple choice questions to sections of a Google Form via Script

I am working on a survey using Google Forms that I generated via a script. There are over 2000 questions that are all the same format but are broken up into different sections. So, for example, ...
1
vote
0answers
52 views

How to make Google Spreadsheet editable only at specific times

I want to create a Google Sheet, where multiple users can insert the name of the company asset they are checking out for the night on one column and get approval from their manager on another column. ...
1
vote
0answers
32 views

How do I automatically update events in my secondary Google Calendar every time I edit my primary calendar?

I have a calendar with events that all happen at the same place. Let's call it my primary calendar. I want to create a secondary calendar and automatically fill it with events "Transport" that ...
1
vote
0answers
199 views

Chart in Google Sheets is duplicating data labels

I'm using Google Sheets and a triggered Apps Script function to create a waterfall chart. Basically this involves breaking apart each value into a base (either visible or invisible), a falling value (...
1
vote
0answers
310 views

Cancellation of form submission link in email, Google forms and Google apps script

For an approval workflow, I am using standard Google Forms and scripts behind the Google sheets to get approval from managers. Is it possible to click "Cancel" link in the email and be redirected to ...
1
vote
0answers
126 views

Google scripts search with manual “next result” option

i am building script in Google Spreadsheet that can find multiple results (like range of given dates) and then first display first result that script find. I need to show me how many results there is (...
1
vote
0answers
392 views

Use Google Apps script in a Spreadsheet from a separate .gs file

I am creating a series of spreadsheets that ought to perform some automation with Google Apps Script. Although the content of the spreadsheets differ, the scripts are the same. I used to be able to ...
1
vote
0answers
37 views

In Matching function, post back the row of a matched element

I am trying to recreate some of my vba macros as functions as Google App Scripts No doubt there are different ways to do this but this is helping me translate my vba skills into gas I want to post ...
1
vote
0answers
437 views

How can I programmatically (using Apps Script) import lots of contacts into Google Contacts?

I want to regularly import a changing list of ~500 contacts. I wrote an Apps Script that does this, but it takes longer than 6 minutes because it has to import each contact individually. I can ...
1
vote
0answers
29 views

How do I perform a calculation on a column whenever a new sheet is uploaded?

I'd like to do a simple calculation every time a new sheet is uploaded to a folder in Google Sheets. The calculation should be automated so the script will recognize a new file and will go to a ...
1
vote
0answers
64 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 ...
1
vote
0answers
65 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
0answers
888 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 ...
1
vote
0answers
83 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 ...
1
vote
0answers
91 views

function to verify all cells in active row

I have a function which is triggered onEdit to enter an ID in new table entries: function IdGenerator(e) { // Get the active sheet var sheet = SpreadsheetApp.getActiveSheet(); // Get the ...
1
vote
0answers
66 views

Detect column D changes with Google Apps Scripts

I would like to detect if the column D rows in my spreadsheet are becoming a date (at the beginning those column rows are empty), so if D1, D2, D3 become a date their text or colors should blink. Now ...
1
vote
0answers
655 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 ...
1
vote
0answers
530 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
0answers
2k 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 footnote ...
1
vote
0answers
263 views

How to make script slow down in GoogleSheets Script Editor?

I have a script thats attached below, and the problem I'm facing is that after it has keyed in "ticker" to Raw Data in b1, my entire sheet is never done loading and thus when its time to check if it's ...
1
vote
0answers
141 views

Automatically create a calendar document using Google Drive and Google Apps Script

Is it possible to use Google Apps Script to 'automatically' create a calendar document in Google Drive with the following document features. Traditional calendar table Accurate month and year ...
1
vote
0answers
391 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
664 views

'setDataValidation' in Google Apps Script not working

Have a problem with setting data validation rules in a Google Sheets using Apps Script. Below are two functions, one is an 'onChange' function which will be triggered whenever a user changes the ...
1
vote
0answers
91 views

Auto paste formula on form submission

I have searched and tried various solutions elsewhere but none seems to work for both conditions. I would like to have the formula: =IF($A2="Elementary", VLOOKUP($B2,'ELEM PRINCIPAL'!$B:$AA,7,false), ...
1
vote
0answers
2k views

'UrlFetchApp' and password protected pages

I'd like to be able to use Google Sheets to login to my registar and automatically list into rows the current name server and email settings of all my sites, rather than use the heinously clunky and ...
1
vote
0answers
267 views

Google Docs: Script Project is not editable for anyone

I created a new Script Project in Google Docs with the following sharing settings: "Anyone who has the link can access. No sign-in required." - "Edit access: Allow anyone to edit (no sign-in required)"...
0
votes
0answers
16 views

Classic Google Sites page throws error on the web browser console

I just noticed that it’s not even my code that causes the error — classic Google Sites page on load is throwing that error. I tried in incognito mode and I still get an error on any page load. I am ...
0
votes
0answers
18 views

Have script code itself dynamically update based on value of cell in sheet?

I'd like to have the script coding itself change as I change the data in a sheet. For example, I have a script set to list the all the files in a particular folder as well as their ids. It spits them ...
0
votes
0answers
9 views

sheet date copy

When you run a macro from the "A" sheet, you need a script that pastes the data from "A1:C1" to the "B" sheet "A:C". We want data to be stacked in a blank space every time we run a macro, whether it's ...
0
votes
0answers
29 views

Get final redirected link from Google's “I'm feeling lucky” function

I need to write a Google App Script function that takes the redirected link from Google's "I feeling lucky" button. The function should take: http://www.google.com/search?q="stackoverflow"&btnI ...
0
votes
0answers
17 views

How to make Google sheets editable only for a few days a month

I have a spreadsheet in which users fill in their names for their shifts for next month, and they should do it only during 20th to 25th in a month but they keep breaking this rule. So I would like to ...
0
votes
0answers
27 views

Dialogue Box Input w/o click (just enter) in Google Sheets

I want to be able to use a barcode scanner to enter data in a dialogue box in Google Sheets. The barcode scanner inserts "enter" after the numbers. How can I make the enter trigger the data entry (...
0
votes
0answers
9 views

Recalculation of references after Copy in Google SpreadSheet

I have the problem of the lost references after a copy in Google Spreadsheet that has been solved in that post with the "Find and Replace" of "=". But is there anyway to do that trick in recalculation ...
0
votes
0answers
23 views

How to update this formula so it automatically updates?

It's come to my attention that GoogleClock no longer works on new sheets, anyway I can update the below code so it can update every minute: Tried put =SheetNames(NOW()) It says not allowed. I'm very ...
0
votes
0answers
17 views

How to parse custom date format in Google Sheets?

I often have sheets with dates written in different formats than the one GS recognizes as a date. What's a painless way to convert those to dates, perhaps by specifying a format string? So to clarify,...
0
votes
0answers
13 views

Blocking cell after changing it's color

I have created simple formula in google sheets which is going to be shared with many people. Sheet will be secured except few columns. I want to let those people edit cell's color in those columns. ...