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

3
votes
0answers
3k 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
30 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 ...
2
votes
0answers
22 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
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
17 views

How do I lock a sheet in Google Sheets at a specific time every day?

I would like the sheet protected from 6pm - 10pm every day. I have the following script but it doesn't seem to protect the sheet at the designated time. I have this script with the Time-based trigger, ...
1
vote
0answers
15 views

Copy formula every other row and every column

I have been playing with scripts to try and figure out this tedious task as there are 600ish rows in my sheet, times 4 sheets. So far I have come up with this function myFunction() { var ss =...
1
vote
0answers
188 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
65 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
29 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
18 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
23 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
24 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
394 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
167 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
163 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
20 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
394 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
58 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
33 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
223 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
341 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
143 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
471 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
38 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
482 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
69 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
74 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
958 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
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
92 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
69 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
689 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
573 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
273 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
407 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
687 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
268 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
8 views

Auto date insert when opposite cell is populated in different columns - only if in a particular sheet in a document

I found this solution to autoinclude the date in a column when another one is modified and it works great. Auto date insert when opposite cell is populated What Im looking to do is: To modify this ...
0
votes
0answers
10 views

How does one import an RSS url as a RSS formated URL?

Currenty I am currently trying to aggregate a few of these urls in order to pull html which I want to display in my Sheet. Problem But currently I am just importing RSS from a news aggregator using ...
0
votes
0answers
13 views

Auto timestamp based on specific value

Currently, I am using below code to update timestamp in the next column. But I want to modify the code to update timestamp only when the cell value is True not on a change of cell value. function ...
0
votes
0answers
19 views

Google Sheets: auto-format an entire column to be hyperlinks upon import

Here's my process: export CSV from CRM > import to Google Sheets > do work. In ColA are unique IDs (all integers e.g. 808938269) of accounts in my CRM. I would like to appended a generic [URL] string ...
0
votes
0answers
19 views

Google Script to Show Rows if cell value

I am working on putting together an Expense Report that allows a person the option to add another expense (up to 23 expenses allowed). I want the rows that need data entry to be hidden unless the ...
0
votes
0answers
11 views

Help with a script for google sheets so that both ends of a link can be edited

so I found a great answer to a question that I had about connecting two different spreadsheets with a link that would allow you to edit either one and the other would update, I found a great page on ...