Questions tagged [google-apps-script]

Use for questions about Google Apps Script, Google's server side Javascript-based cloud scripting platform for automating tasks across Google products and third-party services. Use in addition to relevant product-specific (e.g. [google-sheets], [google-docs]) or API-specific (e.g. [google-drive-api]) tags where applicable

Google Apps Script Logo

Google Apps Script is a server side Javascript-based cloud scripting platform for automating tasks across Google products and third-party services.

Here you'll find links to wonderful resources, helpful tips on asking better questions, and secret chat room links.


How to ask?

General information:
  • Well researched questions are better received by the community. You can start researching by reading or searching the issue in the official developer documentation and the FAQ. Don't ask questions because you want to know the answer, ask questions because you want others to know the answer!

  • Avoid asking questions that are goal oriented. Split up your goal into smaller questions and ask them one by one. For eg, avoid asking "How to create a Google sheet with sports information from this API?". Instead, start writing your code and if you run into a problem getting the correct information, ask "How to send the correct authentication request to this sports API using my username and password, as sending it directly gives me 404?". The latter is a programming question. The former is a business project. Asking volunteers to do unpaid work is frowned upon. See Why is "Can someone help me" not a actual question?

  • Always provide minimal reproducible example. The code should be as minimal as possible, preferably within ten to fifteen lines of code. This requires you to debug your code and takes effort on your part. You can start the process by "Starting from scratch". Don't start with where you are and start reducing. Start from scratch and start adding one by one. See minimal reproducible example.

  • If you reach this point and you are still struggling on how to fix / improve your first question, please read What is the proper way to approach Stack Overflow as someone totally new to programming?. You might also post a question on Meta Stack Overflow including a link to your post. If you get an error when trying to post to Meta, please checkout I'm asking a question about my own post, but I'm still prompted that I need 5 reputation to post here. What gives?.

Specific information:

Tag usage guidance

This is a summary of tags related to Google Apps Script and how to use them in the question being asked.


Community Chat Room

Note: Stack Overflow chat requires a minimum reputation of 20 or be "invited" by a Stack Overflow moderator.


Official Resources


Community Resources


Best Practices


FAQ:

:

53079 questions
29
votes
7 answers

Does Google Apps Script support external IDEs?

I am using Google Apps Script and was wondering if I could use any sort of editor outside of the one Google provides. (I purchased Sublime Text and would like to use that.) The one Google provides is disgusting, with tiny text even though I have a…
programmedpixel
  • 368
  • 1
  • 3
  • 8
29
votes
2 answers

How to hide certain columns for a user?

On a shared Google spreadsheet: I don't want a specific user in my domain to view columns with sensitive data, but this person should still be able to edit the rest of the spreadsheet. I tried creating a 'master' spreadsheet and using importrange…
lee
  • 1,036
  • 2
  • 14
  • 24
29
votes
4 answers

Fill down - Google Apps Script for Spreadsheets

Is there a function that can fill down data to all empty cells from the row above? If not, could anyone help me out with a Google Apps Script (or other solution) that can go through every row in my google spreadsheet, check for empty cells, and if…
Mille
  • 713
  • 2
  • 8
  • 10
29
votes
3 answers

Using built-in spreadsheet functions in a script

I'm using Google App Script for the first time. I'm using it on a Google Doc spreadsheet. I'm trying very simple functions, just to learn the basics. For example this works: function test_hello() { return 'hello'; } But I'm puzzled by this…
29
votes
2 answers

Retrieve rows from spreadsheet data using google app script

I am using Google app script to write form data to spreadsheet. Now I would like to fetch the values from Excel which matches conditions (eg., filtered by date, username) and display them with app script. My spreadsheet has…
palaniraja
  • 10,432
  • 5
  • 43
  • 76
28
votes
5 answers

"MMMM yy"-date in google spreadsheet

I have a google spreadsheet in which I want a date with only the name of the month and the year, like September 2011, and I also want the month and year to be easily changeable. Is there any way of getting custom date formats to do this? I figured…
Clox
  • 1,923
  • 5
  • 28
  • 43
28
votes
6 answers

How to convert a string to number

I can't figure it out how to convert this string 82144251 to a number. Code: var num = "82144251"; If I try the code below the .toFixed() function converts my number back to a string... Question update: I'm using the Google Apps Script editor and…
Valip
  • 4,440
  • 19
  • 79
  • 150
28
votes
5 answers

How to make google spreadsheet refresh itself every 1 minute?

My google spreadsheet is using GOOGLEFINANCE('symbol','price) function to retrieve stock prices of my portfolio. Unfortunately, I have to refresh manually now. How can I make the spreadsheet refresh itself every 1 minute? Thank you for your help.
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
28
votes
3 answers

How do you pass back a custom error message from google apps scripts?

When running a google apps script from a google spreadsheet, if one of the google apis is used incorrectly a red "butterbar" error is shown at the top of the spreadsheet. This message usually contains info that is useful to the script developer (an…
Ralf Haring
  • 1,253
  • 1
  • 10
  • 18
28
votes
2 answers

Create Google Calendar Events from Spreadsheet but prevent duplicates

I'm trying to write a script that will take data from a Google spreadsheet and create events in my Google calendar. I managed that fine but it produced duplicates every time I ran it. So now I'm trying to prevent that by creating a column 17 in the…
27
votes
3 answers

How do you resolve a "The parameters (number[]) don't match the method signature for SpreadsheetApp.Range.setValues" error

I am getting this error: "The parameters (number[]) don't match the method signature for SpreadsheetApp.Range.setValues." in my Google Apps Script when I try to write an array of values to a sheet. Below is a shortened (simplified) version of…
Nico
  • 275
  • 1
  • 3
  • 6
27
votes
4 answers

How to catch UrlFetchApp.fetch exception

Is there any way to catch the exception from UrlFetchApp.fetch? I thought I can use response.getResponseCode() to check the response code, but I'm not able to, for e.g when there is 404 error, the script not continue and just stop at…
louis
  • 353
  • 1
  • 3
  • 8
26
votes
1 answer

How to get form values in the submit event handler?

I'm trying to get started with a very simple Google Form containing just a couple of questions (a multiple choice with just 2 options and a short text). After creating it, I opened the script editor and typed in function onSubmit(e) { …
VZ.
  • 21,740
  • 3
  • 39
  • 42
26
votes
4 answers

How to use a google apps script in multiple documents

I have a google apps script that I want to use in multiple documents. I also may want to change it later in those documents, so it is imperative that I use the same script in all those documents, and not copies of that script. I am aware of the…
P.Péter
  • 1,527
  • 16
  • 39
26
votes
6 answers

Can the google spreadsheet 'query' function be used in google apps script?

I'm looking for a way to programmatically populate a spreadsheet that filters data from another spreadsheet based on the logged in user. I am able to do this using the query function inside a spreadsheet. BUT, unable to figure out a way to call the…
awsamar
  • 263
  • 1
  • 3
  • 6