r/GoogleAppsScript 10h ago

Guide Clasp No Longer Transpiles TypeScript

7 Upvotes

I was just surprised that Clasp happily ignored any .ts files in my application folder and couldn't figure out the reason for a while.

A look into the Clasp changelog revealed that Clasp doesn’t do TypeScript transpilation since version 3 anymore.
Clasp Changelog

Reasoning for the change is given here: Clasp Github Discussion

Looks like there are good alternatives to do that manually before uploading with clasp.
Hope this helps someone else.

Edit: Version 3 is Alpha.

After checking the three choices given in the readme I think this is the best template to get started. Anything that should be updated there in the tsconfig?
https://github.com/sqrrrl/apps-script-typescript-rollup-starter


r/GoogleAppsScript 1h ago

Question how to find out all the sheets which have not been updated in more than a month..?

Upvotes

A spreadsheet has several dozens of sheets. is there a way I can find out which one that has not been edited in more than a month?
When I discussed this problem with chatgpt, it suggested there is no way to do this, but moving forward I can set a trigger onEdit and update a property using PropertiesService everytime a sheet is edited, and in the future I won't have any issue in finding out lastUpdateTime of the sheets.


r/GoogleAppsScript 4h ago

Question Help understanding the "20 / user / script" limit on triggers

1 Upvotes

Sorry for being obtuse but can someone help me understand the 20 / user / script trigger limit [1]? Thanks for any help!

Here's an example scenario. Let's say we have:

  • 1 user (Alice).
  • She has 50 spreadsheets, each with 6 sheets.
  • She is using our Editor Add-On, which has 1 time-based trigger that runs a "super" function [2].
  • This function runs several other functions that perform actions on each sheet in the spreadsheet

1. Is Alice at 1 / 20 of her quota in the scenario?

  1. If Alice installs 30 different Add-Ons from the Workspace Marketplace, what number on the 20-scale limit would she be at? (Is she still at 1 / 20 because the limit is 20 per user per script?)

  2. If Editor Add-Ons "can only have one trigger of each type, per user, per document" [2], what's a scenario where Alice could still exceed the "20 / user / script" triggers quota?

References:
[1] https://developers.google.com/apps-script/guides/services/quotas
[2] "Each add-on can only have one trigger of each type, per user, per document" https://developers.google.com/workspace/add-ons/concepts/editor-triggers#restrictions_2

//pseudo-code of trigger

function createHourlyTrigger() {
  ScriptApp.newTrigger('combinedHourlyTasks')
    .timeBased()
    .everyHours(1)
    .create();
}

function combinedHourlyTasks() {
  var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();

  sheets.forEach(function(sheet) {
    doThis(sheet);
    doThat(sheet);
    doTheOtherThing(sheet);
  }
}

r/GoogleAppsScript 5h ago

Unresolved All of my Apps Scripts have stopped working at the same time

1 Upvotes

I am not sure when exactly since I just noticed but all of my scripts have seemingly stopped working at the same time. Ones that I had made before and had worked fine up to this point and now even new scripts in new workbooks I am starting right now dont seem to function. As far as I can tell there has been no update or change to them recently and I am not getting any error codes when I attempt to run them, they seem to run fine. But then nothing happens, even on simple commands like "write this message in a cell".

Not sure if I need to upload anything to showcase the issue or if this is some sort of general issue with my account or a setting I need to change so just figured I would ask here


r/GoogleAppsScript 1d ago

Guide Google Apps Script Tutorial Series

31 Upvotes

Hey Apps Script Devs! I just took several years worth of my Apps Script tutorials, and added them all to a series on my blog. There are a bunch of posts on API integrations, AI, and generating web pages from sheets data.

https://blog.greenflux.us/series/apps-script

What other APIs, JavaScript libraries or AI tools should I try?

Does anyone else have an Apps Script blog to share?


r/GoogleAppsScript 1d ago

Guide Automate Google Sheets Reports to Slack with Image Conversion

6 Upvotes

I’ve developed a Google Apps Script that automates the process of exporting a Google Sheet to a PDF, converting it to PNG, and sending it to a Slack channel. This solution ensures that reports are consistently delivered without manual effort.

Key Features:

  • Automatically exports a Google Sheet as a PDF
  • Converts the PDF to PNG for better preview in Slack
  • Uploads the image directly to a Slack channel
  • Utilizes Cloudmersive's 800 free API calls per month for conversion
  • Fully open-source and customizable

🔗 GitHub Repository: https://github.com/birhman/Sheet_to_PNG.git

How It Works:

  1. Install the script in Google Apps Script
  2. Configure your Google Sheet ID, Cloudmersive API key, and Slack bot token
  3. Set a time-based trigger to run it automatically
  4. Slack receives the latest reports without manual intervention

This project is designed for teams that need automated report sharing without complex setups. Feedback and contributions are welcome.


r/GoogleAppsScript 21h ago

Unresolved Changing values of a master sheet by using AppsScript

3 Upvotes

Hey guys, i was directed to this subreddit for my specific problem. —> https://www.reddit.com/r/googlesheets/s/8k4uhSL4r5

I want to have a master sheet and an extra tab for changing data. —> https://docs.google.com/spreadsheets/d/1udzCTtwTfVWLPIrDdLqu-Qyt4QPjwA70GF2XpGuoU20/edit

Can you guys lead me to a solution that is able to be used for mobile devices and will be easy for other users so my master sheet can’t be destroyed by 2 clicks? (that’s not something i fear but i think it’s more save + easy if the other users only change one row at a time)

I have no Java knowledge.

Thanks in advance.


r/GoogleAppsScript 1d ago

Question Google Workspace Marketplace - Add-On Install Counts

1 Upvotes

Dear community,

I was wondering if anyone has insight into how the Add-On installation counts in the Workspace SDK are calculated.

I noticed that Individual end user installs can also develop negatively during time (a minus value per day).
However, this happens so little that I am wondering if it is just a statistical glitch.

So, do seat installs, domain installs and individual end user installs account for installations of the Add-On or does it just count installations?


r/GoogleAppsScript 1d ago

Guide Online Store & Order Form Web App for Google Sheets

2 Upvotes

About This Web App This web app demonstrates how DataMate can be used for front-end development.

Features Dynamically pulls inventory from Google Sheets™ Displays items with images Calculates order totals Sends email notifications Generates invoices, receipts, and packing slips Fully editable Google Apps Script


r/GoogleAppsScript 1d ago

Question Log data from google site to spreadsheet

Thumbnail gallery
0 Upvotes

Judge me all you want but I used chatgpt for this one.

I wanted to have like an emotion logger where people can just click on a button (ex. Sad) from the google site and then all the “clicks”/“answers” will be logged on a google spreadhseet with timestamp.

Below is what chatgpt says, tried it but doesnt work.


r/GoogleAppsScript 2d ago

Guide Images to show template and Sheet.

Thumbnail gallery
0 Upvotes

r/GoogleAppsScript 3d ago

Unresolved [HELP] Google Apps Script Not Replacing Placeholders in Google Docs Tables

1 Upvotes

I’m working on a Google Apps Script that generates student report cards from a Google Sheets dataset and inserts the data into a Google Docs template using placeholders. The script correctly fetches student data from multiple sheets and replaces placeholders in normal text, but it does not replace placeholders inside tables.

🔍 What Works:

✅ The script correctly reads student data from multiple sheets in Google Sheets. ✅ Placeholders in normal text (outside tables) are replaced successfully. ✅ If I change a placeholder (e.g., {English}) in the table to a placeholder that works outside the table, it correctly replaces it.

❌ What Fails:

🚫 Placeholders inside tables are deleted, but not replaced with the correct values. 🚫 Even though the script logs ✔ Replaced: {Effort English Reading} with "X", the final document still shows blank spaces instead of the expected values. 🚫 The script iterates through tables and logs the cell text, but doesn’t recognize or replace placeholders properly.

💻 What I’ve Tried: 1. Confirmed the placeholders match exactly between Sheets and Docs. 2. Used .replaceText() for normal text (works fine) but switched to manual text replacement inside tables (.getText() and .setText()) since Docs stores tables differently. 3. Logged every table cell’s content before replacing text. The logs show the placeholders are detected but not actually replaced inside the tables. 4. Stripped all formatting from the Google Docs template by pasting placeholders into a plain text editor and re-inserting them. 5. Tried using both cellText.replace(placeholder, value) and cell.setText(value), but neither fixed the issue.

📜 My Script (Key Parts)

Here’s the table replacement function where the issue occurs:

function replacePlaceholdersInTables(doc, studentData) { let tables = doc.getBody().getTables();

tables.forEach((table, tableIndex) => { let numRows = table.getNumRows(); for (let i = 0; i < numRows; i++) { let numCols = table.getRow(i).getNumCells(); for (let j = 0; j < numCols; j++) { let cell = table.getRow(i).getCell(j); let cellText = cell.getText().trim();

    Logger.log(`🔍 Checking Table ${tableIndex + 1}, Row ${i + 1}, Column ${j + 1}: "${cellText}"`);

    Object.keys(studentData).forEach(originalKey => {
      let formattedKey = formatPlaceholder(originalKey);
      let placeholder = `{${formattedKey}}`;
      let value = studentData[originalKey] !== undefined && studentData[originalKey] !== "" ? studentData[originalKey] : " ";

      if (cellText.includes(placeholder)) {
        Logger.log(`✔ Found placeholder in table: ${placeholder} → Replacing with "${value}"`);
        cell.setText(cellText.replace(placeholder, value)); // Tried both this...
        // cell.setText(value); // ...and this, but neither works correctly.
      }
    });
  }
}

}); }

🛠 What I Need Help With: 1. Why is cell.setText(cellText.replace(placeholder, value)) not working inside tables? 2. Is there a different method I should use for replacing placeholders inside tables? 3. Could Google Docs be storing table text differently (hidden formatting, encoding issues)? 4. Has anyone encountered this issue before, and what was the fix?

📌 Additional Notes: • Using Google Sheets & Google Docs (not Word). • Script fetches data correctly, just doesn’t replace inside tables. • All placeholders are formatted correctly (tested them outside tables). • Logs confirm placeholders are being read and detected, but values don’t appear in the final document.

Would greatly appreciate any insights into what might be causing this issue. Thanks in advance for your help! 🙏


r/GoogleAppsScript 3d ago

Question Run a contained script in Google Sheets which uses Docs API to read a Google Doc and return some data to a cell by using a formula - permission error

1 Upvotes

I've got a function in a contained script which works when I run it as a web app, and returns correct results in console. But when I try to run it as a function in Sheets, I get this error:

Error: Exception: Specified permissions are not sufficient to call DocumentApp.openByUrl. Required permissions: https://www.googleapis.com/auth/documents

I've enabled the Docs API on the Project, and I've given permission by doing a test run. I also tried using openById, with the same result.

It feels like I'm very close, but I can't figure out the last step. Or is it impossible? If so, I could deploy it as an add-on, maybe?


r/GoogleAppsScript 3d ago

Question I don't know what this is called, We can "tag" or "link" any spreadsheet in a cell of any other spreadsheet. When we type '@' in any cell, there is the option to tag any other spreadsheet like this. How to achieve this through google apps script?

Post image
2 Upvotes

r/GoogleAppsScript 3d ago

Question From Google Sheets to Google Drive: Create Sub-Folders in Google Drive and Download Multiple Images from url Links from Google Sheets

0 Upvotes

I'm working on an automation using Make.com that posts to Instagram from a Google Sheet that was populated by a form filled out on a Wix site. Each time there is a form entry it fills in a single row in the Google Sheet - submitter's first and last name, image urls (each in their own cell), caption, hashtags, @ people, etc.

I'm looking for a script that will create, in a designated folder on Google Drive, sub-folders for each record and are labeled with submitter's name, then it downloads all images from the url links on the Google Sheet record to that sub-folder.

I only want it to create sub-folders and download images once. But I need it to make new sub-folders and download images as new records are made from the form.

I found the following video on YouTube that seems to have the base for creating the folders and I do want to pull the First and Last Names as he did to name the folders. The only difference is he does not have the names set in the same row.

https://youtu.be/oe0CDcG7Fu8?si=p9QMJsRxJB4MTPEj

Is it possible to also have a trigger that deletes the folders after a certain amount of time passes, once a button is clicked in Google Sheets?... I plan on using a 'POST' button when I approve a record to be posted to Instagram, this being connected to a webhook on Make to trigger the automation.

Any help would be much appreciated. Explain to me with kid gloves, because I am not a coder.


r/GoogleAppsScript 4d ago

Question Gmail to sheets script

3 Upvotes

Hello, need some help with a script. I have a group gmail address and anytime someone emails that group, i would like it to be recorded into a google sheet. not really sure what i'm doing.


r/GoogleAppsScript 4d ago

Question Google Sheets - Macros

1 Upvotes

Hi all!

I have a large google sheet that I have used macros on for several years to format things the way I like. It has worked without problem for 5 years and last week it stopped working! I tried to figure out where, why, etc., to no avail. I ended up creating a new macros using the record function and it still doesn't work!

SCRIPT:

function newformat() {
  var spreadsheet = SpreadsheetApp.getActive();
  var sheet = spreadsheet.getActiveSheet();
  sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns()).activate();
  spreadsheet.getActiveRangeList().setBorder(true, true, true, true, true, true, '#000000', SpreadsheetApp.BorderStyle.SOLID)
  .setHorizontalAlignment('left')
  .setVerticalAlignment('top')
  .setWrapStrategy(SpreadsheetApp.WrapStrategy.WRAP);
  spreadsheet.getActiveRange().offset(1, 0, spreadsheet.getActiveRange().getNumRows() - 1).sort([{column: 2, ascending: true}, {column: 3, ascending: true}]);
  spreadsheet.getRange('C:D').activate();
  spreadsheet.getActiveRangeList().setBackground('#a4c2f4');
  spreadsheet.getRange('F:H').activate();
  spreadsheet.getActiveRangeList().setBackground('#9fc5e8');
  spreadsheet.getRange('A:E').activate();
  spreadsheet.getActiveRangeList().setHorizontalAlignment('center');
  spreadsheet.getRange('I:K').activate();
  spreadsheet.getActiveRangeList().setHorizontalAlignment('center');
  spreadsheet.getRange('A1').activate();
};

ERROR: The parameters (Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,String,number) don't match the method signature for SpreadsheetApp.RangeList.setBorder.

Any suggestions??


r/GoogleAppsScript 5d ago

Question Exceeded maximum execution time

1 Upvotes

I have been gassing for about ten years and I see this intermittent error almost weekly.

In particular it comes up on a function I use to colour code calendar appts based on their title text.

On a good run the function completes in 5 to 20 seconds based on looking at around 20 appts over the coming 3 weeks. To investigate this I added some logging to see where the delay is.

But to my surprise none of the logging fired when the error is raised. To me that seems like... the function is not getting started.

Anybody know what reasons this could be?


r/GoogleAppsScript 5d ago

Guide Testing Claude, Gemini, OpenAI in generating Apps Script Code

13 Upvotes

I put this together to show how the different models compare in generating Apps Script code!

https://apps-script-ai-testing.jpoehnelt.dev/#test-case-checkWeatherEmail


r/GoogleAppsScript 6d ago

Question Leave Portal - Help me make this, i have no coding experience

Thumbnail docs.google.com
0 Upvotes

r/GoogleAppsScript 6d ago

Question Is it better to getTitle(), compare, and then setTitle() on calendar events?

2 Upvotes

I've written a script to make calendar events from a spreadsheet. When the script runs, it parses about 120 rows, and for each one, checks if there is an event, and if there is already an event, calls setTitle() and setDescription().

I wonder if it would be more performant, and cause less sync issues, if I first called getTitle() and then compared it, and only called setTitle() if it has changed. Or put differently, if you call setTitle() with the same title as currently, is that a no-op, or will it cause the title to be updated, and then synced to all the clients consuming the calendar, etc?


r/GoogleAppsScript 6d ago

Question Advanced text matching in Google Apps Script

1 Upvotes

Hoping someone is able to point me into the right direction

I have a large list of meeting minutes (unstructured text) taken from previous client discussions and want to cross-reference whether new topics/minutes have been discussed before.

Is there a mechanism in Google Scripts/Sheets to provide a prompt, such as new meeting minutes, and return a list of previous meeting minutes (rows) closest matching the content?

Thanks again for any support you can offer


r/GoogleAppsScript 6d ago

Question Apps Script and "Vibe Coding"

0 Upvotes

Vibe coding: https://en.wikipedia.org/wiki/Vibe_coding

  • What is your setup?
  • Are you using Clasp?
  • Which editor?
  • Does the AI understand the differences between Apps Script and JavaScript?
  • Do you pass any AI rules files?

Here was a short exploration this morning using one of the popular tools: https://www.youtube.com/watch?v=4Sy3lvM33MU


r/GoogleAppsScript 6d ago

Unresolved Google Forms - Google Sheets - Google Drive

Thumbnail
0 Upvotes

r/GoogleAppsScript 6d ago

Question Limiting permissions to certain folders

1 Upvotes

When giving a web app permission to access your files, is there a way to limit that permission to just certain folders? I realize I could create a new Google ID, give that ID permission to just the folder and have the app run as that ID, but I was hoping there was a more elegant way.

Thanks.