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
22
votes
4 answers

Google gmail script that triggers on incoming email

I've been reading through gmail addons. They have contextual triggers that trigger when you open an email. Is it possible to trigger a service when an email is received by me? Best I can find is unconditional but that only triggers when the email is…
Jeff
  • 4,285
  • 15
  • 63
  • 115
22
votes
2 answers

How can I see the full server response for this API error message in Google Scripts?

I'm getting an error response from the API that I'm using, but Google scripts seems to truncate the message. How can I see the full message in Google scripts? This is the message: Request failed for https://api.myintervals.com/task/ returned code…
Takeshi Patterson
  • 1,207
  • 6
  • 15
  • 29
22
votes
3 answers

If var isnumber, for script

I need to run a script which contains the logic: If isNumber, Then DoSomething. I've run other such if then tests such as if blank, and if cell contains "x". It should be simple but I can't find a solution. I've tried getNumberFormat, innum,…
MinneapolisCoder9
  • 601
  • 1
  • 11
  • 29
22
votes
5 answers

How to add a hyperlink in a Google Docs using a Google Script

I have always used the insertText() function, but now I want to write a link in my google docs. The ideal would be to be able to write in HTML, but I don't know how.. it seems that it is not possible with the insertText() function. How can I do that…
qcha
  • 523
  • 1
  • 5
  • 19
22
votes
3 answers

How to display zero in place of error in filter formula in google spreadsheet

I am new to Google spreadsheet functions and trying to apply a formula in following way: I have sheet1 & sheet2 in one workbook (name-formula4). I am doing sumproduct of filtered range from sheet1 to sheet2 with the following…
user3811050
  • 467
  • 1
  • 3
  • 12
22
votes
3 answers

Is it possible to publish an Add-on for internal use without approval process?

Is it somehow possible to publish add-on without Google approval if it is going to be used for my internal use only? If not, is there any possibility to make some of the Google Apps Script projects global. So that I would not need to copy same…
Maksim Luzik
  • 5,863
  • 4
  • 36
  • 57
22
votes
2 answers

How to import functions in Google Apps Script

I have two Apps Script Code.gs and Code2.gs I would like to import function A in Code2.gs and use it in function B in Code.gs. Any ideas ?
Vinay Joseph
  • 5,515
  • 10
  • 54
  • 94
22
votes
5 answers

Google Apps Script, copy one spreadsheet to another spreadsheet with formatting

Hopefully this question has not already been answered. I have spent a considerable amount of time searching, and although I have found similar posts, none have done exactly what I am trying to do. I would like to use Google Apps Script to copy a…
user2956591
  • 223
  • 1
  • 2
  • 4
22
votes
4 answers

Converting a string timestamp to Date results in reset to UNIX epoch

I'm having some problems converting a string to a date object in google apps script. My dates are in the following format, from a 3rd party API: 2013-01-17T17:34:50.507 I am attempting to convert this to a Date object: return Date(stringDate); And…
Sherlock
  • 5,557
  • 6
  • 50
  • 78
22
votes
4 answers

Google Apps Script make HTTP POST

I would like to make an HTTP POST using google apps script. I have found very little documentation on this, maybe someone could kindly help? The HTTP POST will be to a service called 'Twilio': https://www.twilio.com/docs/api/rest/sending-sms The…
Vin
  • 1,975
  • 5
  • 27
  • 34
21
votes
3 answers

Google Spreadsheet Form, populate form options based on a spreadsheet

I need to find a way to have the multiple choice options in a Google form change based on a set of cells in a Google Spreadsheet that is constantly changing. Any ideas?
Andrew Woodard
  • 545
  • 1
  • 7
  • 21
21
votes
4 answers

We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED

I wrote a google scripts editor addon, and published it to the google marketplace with private visibility (it is only visible to the users in my organization). I tested the addon with all types of permissions (installed for current user, enabled in…
21
votes
2 answers

What is the difference between getActive() and getActiveSpreadsheet() in Apps Script?

Whats the difference between these two methods from class SpreadSheetApp in Google Apps Script? Both return "currently active spreadsheet, or null if there is none". Whats the difference between them, exactly? When should I use each one?
nanquim
  • 1,786
  • 7
  • 32
  • 50
21
votes
9 answers

Moving Files In Google Drive Using Google Script

I'm trying to create documents using information posted through Google forms, then once the document is created I would like to move the document into a shared folder for people to view. At the moment I have the script taking all of the information…
S Woodhouse
  • 211
  • 1
  • 2
  • 4
21
votes
2 answers

How do I make copy of spreadsheet and save it to particular folder?

I'm working with Google App Script. I am trying to: Make a copy of a spreadsheet Give the copy a particular file name, and Save it to a particular folder. It seems to me that the code below should work, but it doesn't. It does accomplish tasks 1…
Jeff
  • 337
  • 1
  • 3
  • 6