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
5
votes
1 answer

Remove need to click before typing when activating a range via a drawing-launched script

I am writing a simple script for a Google Sheet. I have a button labeled "New Entry" (the button is actually a drawing with my script assigned to it). When the user clicks the button, the script inserts an empty row at a specified location and…
Andrew
  • 61
  • 5
5
votes
1 answer

How to add Named Ranges to sub-paragraph elements in Google apps-script

I would like to implement a 'html-span-like' feature inside Google Documents but whenever I try to add a NamedRange to a substring of text inside a Google Document, the range is merged with previous text in the same paragraph. In result, the…
Laurent'
  • 2,611
  • 1
  • 14
  • 22
5
votes
1 answer

How to extract EXIF data from jpeg files in Drive

I am trying to extract EXIF data from several jpeg files located in one of my Google Drive folders, using a Google Script. More accurately, I would like to extract the date at which the photo was taken, together with associated keywords /…
qcha
  • 523
  • 1
  • 5
  • 19
5
votes
2 answers

How can I make an RSS feed from Youtube search using Google App Script?

Since Youtube shut down its RSS feeds for searches with it's newest version of the API, I've been trying to recreate them using Google App Script. Here's what I have so far (based off of this tutorial for converting a twitter widget to…
user1535152
  • 256
  • 4
  • 17
5
votes
2 answers

Google Drive - How to List all Files in a specified folder

Hi I am stuck here with this situation, I have tried a number of different approaches but I cannot get what I am after. Situation: I have a large number of files in folders hosted on google drive. For instance a single client folder for reports has…
5
votes
1 answer

Google Apps Script: Create New Document (Spreadsheet) from Template

I'm currently doing this: //set active spreadsheet to my template var ss = SpreadsheetApp.openById("MYSHEETKEY"); SpreadsheetApp.setActiveSpreadsheet(ss); //duplicate active sheet and set a new name …
James
  • 83
  • 2
  • 6
5
votes
1 answer

google-apps-script count files in folder

I've had a search but cannot seem to find what I am looking for. I am seeking the code to enable me to do this pseudocode: Count number of files in specific Google Drive folder (by folder Id) If file count is above 'x' do this {other piece of…
witham
  • 139
  • 1
  • 2
  • 13
5
votes
1 answer

Proper way to deal with UrlFetch rate limit without random Utilities.sleep?

Our add-on for Google Sheets provides users with an extended library of functions. The problem is, each function run does a UrlFetch. So if users drag a column down > 100 times, they will likely see the error: "Error: Service invoked too many times…
bumpkin
  • 3,321
  • 4
  • 25
  • 32
5
votes
1 answer

How to execute multiple functions in google apps script in order?

Thanks in advance for your time here. I am self taught and new to coding, hence apologies if the question below is something an average programmer should already know. I have created multiple functions in a single gas file, which when run…
rakesh bhat
  • 53
  • 1
  • 2
  • 3
5
votes
1 answer

What's the difference between ui.alert and Browser.msgBox?

When working with Google Scripting, there's a Browser.msgBox(); (Link) and ui.alert(); (Link). What is the difference between the two? They appear to do the exact same thing. There are more methods within, such as Browser.inputBox(); and…
UtahJarhead
  • 2,091
  • 1
  • 14
  • 21
5
votes
1 answer

Google App script Cache service quota

What is GAS's quota for cache service? It's missing from documentation. https://developers.google.com/apps-script/guides/services/quotas
angelokh
  • 9,426
  • 9
  • 69
  • 139
5
votes
1 answer

get google doc as HTML in google app script

How can I get google doc as HTML in google app script? For example. I can get document body like so. DocumentApp.getActiveDocument().getBody(); But when I log it there is nothing.
Ararat Harutyunyan
  • 916
  • 1
  • 8
  • 19
5
votes
0 answers

How to prompt user response on a standalone Google Script

So in my standalone Google Script, I have to take in a user input that will ultimately allow me to get information about a user's Google Calendar. The CalendarApp object does not have a getUI() method nor a "Tools > Script editor" menu command. So…
Anthony
  • 311
  • 1
  • 3
  • 13
5
votes
2 answers

How to process all named ranges in a Google Sheet?

Is there a way to process all of the Named Ranges in a Google Sheet? Google Documents has .getNamedRanges(), but I can't find anything similar for sheets. I want to read and print each range parameter. My end goal is to fix a lot of named ranges en…
UtahJarhead
  • 2,091
  • 1
  • 14
  • 21
5
votes
2 answers

google not defined in google script - Error

I get the error "google is not defined", from my google script that creates a table using google.visualization. How do you add a reference to a google script, and if I get it to run in scripts will I also have to add it to my google site? I'll put…
Luk6e
  • 170
  • 2
  • 12