Stack Exchange Network

Stack Exchange network consists of 175 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

4
votes
0answers
4k 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
140 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 ...
2
votes
0answers
29 views

Transactional execution in Google Sheets Script?

I am working on a script that moves quite a bit of data around in a spreadsheet, and in some cases appends data to data. When the script finishes, clicking undo cycles through each step that the ...
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
3k 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 ...
2
votes
0answers
142 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
10 views

How can I add in a date macro to a Google doc?

Really grateful for this answer from Thomas Wiersema, but am keen to find out what the issues might be if the Utilities menu isn't showing up after you've followed his instructions via Google scripts. ...
1
vote
0answers
40 views

How can I prevent editors from accessing the script editor in Google Sheets?

I have an auto sort script on a Sheets document that I will be giving multiple people editing permission to, to add to the file. I have created a trigger so the script also runs when other users edit ...
1
vote
0answers
35 views

Script to transfer data from invoice sheet to database

This is my first post and I'm new to scripts. Upon searching through multiple questions similar to mine, I couldn't find exactly what I was looking for. I want to create a macro that pulls specific ...
1
vote
0answers
323 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
36 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
23 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
37 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
29 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
245 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
242 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
488 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
500 views

Edit URL, Google Forms

Is it possible to get the edit URL of Google Forms if you are not sure of the form response number? For example, I have 2,000 forms submitted and I would like to generate the edit links for them now ...
1
vote
0answers
60 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
34 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
261 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
408 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
165 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
560 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
41 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
520 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
70 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
79 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
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 ...
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 ...
1
vote
0answers
93 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
70 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
730 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
662 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
293 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
416 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
705 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
92 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
270 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
4 views

Apps Script to skip files that have no blank rows

I created a script to delete blank rows from many spreadsheet files. the script I created like this: function delRow(id, name, startRow, blankRow){ SpreadsheetApp.openById(id).getSheetByName(name)....
0
votes
0answers
13 views

How to keep “HH:mm:ss” as “HH:mm:ss” when archiving to new sheet

I am trying to script a function that pastes values into a new google spread sheet, one of the rows is a time in CST and in the archive sheet gets pasted as "12/30/1899" with the regular time. e.g 11:...
0
votes
0answers
15 views

Google Sheets - pull static value from cell that will change later

I have a sheet where I calculate the average of the daily value for the past 30 days with a rolling average. I'd like to be able to pull the daily values and store them in another sheet. I want to ...
0
votes
0answers
13 views

Trying to figure out a Google Script

Looking for help on a script. To pull new rows from one sheet to update my report without duplicates or erasing manually made changes to current rows. I was originally using =ARRAY_CONSTRAINT() at the ...
0
votes
0answers
8 views

Is there a way to link to highlighted sections in a Google Doc?

I have a large document that has multiple highlighted sections. The highlights are color-coded such that all blue highlights belong to one topic, while green highlights belong to another topic, etc. I ...
0
votes
0answers
17 views

Set boders to a range if first cell in row is not empty

I need to set borders to a range in row if first cell in this row is not empty. I have this code function onEdit() { var ss = SpreadsheetApp.getActiveSpreadsheet (); var sheetmon = ss....
0
votes
0answers
16 views

Issue with SUMIFS pulling data from QUERY across multiple sheets

I would like to sum values from a QUERY generated list in the sheet I/S/N/W to the sheet BUDGET for determining a value based on the date in BUDGET!B8. The function in BUDGET!B8 is =MONTH(TODAY()). ...
0
votes
0answers
25 views

Loop through all sheets with macro

I have a macro that I want applied to all my sheets. I tried applying different codes I've found online but it only goes through the first sheet before stopping. function LoopThrough() { var ...