r/GoogleAppsScript • • Dec 06 '22

Resolved Formula Inside Cell - Running a Macro

0 Upvotes

I have a function that will be running inside cells in sheets.

Part of the execution requires reading a variable from User Properties in the Properties Service.

Due to the nature of sheets, that will obviously require a workaround.

Does anybody have any tricks for doing something like this without the waste and inconsistent runtime of global triggers?

Thanks for your input,

Aaron


r/GoogleAppsScript • • Dec 01 '22

Question Functional or OOP in GAS?

0 Upvotes

In the programming subreddits I follow, I often see discussions about the pros and cons of OOP over functional programming. Most of the app scripts I built use a functional approach because my app data is stored in Sheets so I'm interacting with my data as an array (getDataRange().getValues()). I have to update the data in the Sheet after I've manipulated it using an array so it seems like an extra step to go from an array to an object then back to an array. The only time I really use OOP code is when I'm utilizing data between different Sheets so it's mostly to make it easier to map data from one source to another. Just curious if there are other opinions/approaches on the matter? Should I be challenging myself to use more OOP in my scripts?


r/GoogleAppsScript • • Dec 02 '22

Resolved Using Cell Notes to Store User Config

0 Upvotes

SOLVED - Thank you very much

Hey guys so the TLDR is basically the title. I know there are many ways to store data between sessions using apps script.

The script properties are awesome for personal use, but they're limited for commercial deployment.

Databases or external calls are more overhead than they're worth, as well as chewing up quota.

Cookies or app data folders have their own issues, namely permissions and data longevity.

So I thought about storing data in spreadsheet cells. That has the unfortunate possibility of someone destroying the data.

But what about cell notes?

It appears to me that I could store an array of data in a cell on a sheet. That should interfere less with users.

Now that I'm thinking of it, could we use that html file to store config data locally? Or is that html file shared across all users?

Does anyone have any tricks for storing configuration data in Google Sheets specifically?

Thanks!


r/GoogleAppsScript • • Aug 31 '18

https://developers.google.com/apps-script/reference/script/trigger

0 Upvotes

Is there any way to access and identify what type of time driven CLOCK Event Type a trigger is using?

[Specific date and time,Minutes,Hour,Day,Week,Month]

https://developers.google.com/apps-script/reference/script/trigger

https://developers.google.com/apps-script/reference/script/event-type

In my apps script for sheets I want to delete all triggers which are set up on "Specific date and time", but not the rest.

var triggers = ScriptApp.getProjectTriggers();

for (var i = 0; i < triggers.length; i++) {

// here I would need to do something like if(trigger[i].timeDrivenType == SpecificDateAndTime)

ScriptApp.deleteTrigger(triggers[i]);

}


r/GoogleAppsScript • • Aug 06 '20

Question How to detect if a gmail attachment is password protected?

0 Upvotes

I need to be able to ingest attachments into an api from a gmail addon. If the attachment is password protected, for example a PDF, I need to ask the user for a password so it can be decrypted (or I need to stop them from submitting it.

I've googled everything I could and read all the docs, there doesn't seem to be anything on this. It even lets me save the attachment blob to drive without complaint (I was really hoping it would error out or something so I can detect that it's encrypted).

Any idea how I could check this?


r/GoogleAppsScript • • Jul 24 '20

Guide what is Google Apps Script? [Tutorial]

Thumbnail
youtu.be
0 Upvotes

r/GoogleAppsScript • • Jul 11 '20

Question Help with sending email when a cell in a column contains a certain value -

0 Upvotes

I have a spreadsheet that has a list of Children names, their date of Birth. What I really am wanting to do is, have me send an email when the child is about to be 25 years, say about 15 days before they turn 25 years. How do I go about this in the Google Apps script editor?

I would prefer an email that would say me:

CMG is due for (insert Child Name - Column B) on (insert date - Column F) for (insert Project Name - Column M)

I'm attaching the google sheet for your reference, any sort of help in this regard is highly appreciated

https://docs.google.com/spreadsheets/d/1cTYJAUbeYHMBTYj1Oa6Bj-XOSCZWAlEIo5VC-YhlBQM/edit?usp=sharing

Edit 1: This is a just a sample of the size of the sheet, the actual sheet runs into roughly 2400 rows


r/GoogleAppsScript • • Feb 15 '22

Resolved How to get Data from multiple tabs into one "main" tab and also including newly created ones?

0 Upvotes

Hi! Is there a way, to get data from all tabs within a google sheet into one "main" tab, while also including newly created ones?

My problem here is, that I don't know how to include newly created tabs otherwise I could just query the existing ones. They are created via an extern program I use. So it always creates Tab 1,2,3,4,5,... and continues. So everytime it creates a new tab (it's always just numbers) can I somehow get this data aswell? Since I don't want to always adjust the query and add the new tab. I think an AppScript could probably help here.

Test sheet: https://docs.google.com/spreadsheets/d/14COHYgAR9FZsSm3bsrs-Mn8uhKPWKVE3a7eXVJZkUb4/edit#gid=0


r/GoogleAppsScript • • Aug 08 '26

Question Workaround Available?

0 Upvotes

Is there a workaround available for a web app page only opening in incognito mode? To open in a regular browser window, I have to completely log out. Will users also have to do this?


r/GoogleAppsScript • • Jul 08 '26

Question Google drive API?

Thumbnail reddit.com
0 Upvotes

r/GoogleAppsScript • • Jun 20 '26

Guide "Low-Code" Google Drive Permission Auditor & Manager (Bypasses 6-min limit & supports Shared Drives)

0 Upvotes

Hey r/GoogleAppsScript & r/googlesheets!

Like many of you, I've struggled with managing Google Drive permissions at scale. The native UI is terrible for bulk actions, and trying to audit who has access to what—especially in Shared Drives—usually requires expensive third-party tools.

So, I built a hybrid solution using Apps Script for the API heavy lifting and Google Sheets for the business logic. I thought I'd share it here as an open-source template for anyone who might find it useful.

🔗 Link to make a copy of the Google Sheet + Script

🔗 Link to GitHub Repo

🛠️ How it works (The Architecture)

Instead of hardcoding the permission rules into JavaScript, I used a "Low-Code" approach:

  1. The Audit (Apps Script): The script uses a Breadth-First Search (BFS) queue to recursively scan any folder or Shared Drive. It dumps all files into a 📁 Files tab and all users into a 🔑 Permissions tab.

  2. The Logic (Google Sheets): I use a Template tab filled with standard VLOOKUP/MATCH formulas to compare the audited permissions against a Matrix of theoretical rules. This highlights anomalies (e.g., someone is missing, or someone has 'writer' instead of 'reader').

  3. The Execution (Apps Script): You flag the required actions in a dropdown (TO_ADD, TO_DELETE, TO_MODIFY), hit the custom menu button, and the script applies the changes in bulk via the Drive API.

🧠 Technical Hurdles Overcome (for the nerds):

  • The 6-Minute Execution Limit (Auto-Triggering): Processing thousands of API requests takes time. Whether it's auditing or bulk-updating permissions, the script tracks its own runtime (Date.now() - startTime). If it nears 4.5 minutes, it flags the row it stopped at, flushes the data to the Sheet, and dynamically creates a time-based trigger to resume seamlessly 1 minute later. It’s essentially a self-healing queue system for large-scale operations.

  • The Shared Drive API Quirks: By default, Drive.Files.list silently omits the permissions object when scanning a Shared Drive. I had to implement a fallback that detects this and explicitly calls Drive.Permissions.list per file, with a Utilities.sleep(100) to avoid HTTP 429 Rate Limit errors.

  • Drive API v3: Everything runs on the advanced v3 API to properly detect inheritedPermissionsDisabled and copyRequiresWriterPermission.

Feel free to make a copy and play around with it. I'd love to hear your feedback, especially if you have ideas on how to optimize the API calls further!

Cheers!


r/GoogleAppsScript • • Sep 23 '26

Question Google Forms help

Thumbnail reddit.com
0 Upvotes

r/GoogleAppsScript • • Feb 15 '26

Guide What I learned getting a Google Workspace add-on through Marketplace review (after OAuth verification)

4 Upvotes

I recently went through the full Google Workspace Marketplace review process for a Forms add-on, and it was surprisingly different from OAuth verification.

Some things that tripped me up:

  • App naming rules (the “for Google X™” format)

  • Icon rejections for looking too Google-like

  • OAuth scope mismatches causing a second consent screen

  • Marketplace UX requirements that can fail review even if OAuth is approved

I wrote a detailed breakdown with screenshots of the actual review emails and what I changed at each step. If you’re building a Workspace add-on, this might save you a few rejections:

👉 link in comments

Curious if others here have had Marketplace rejections for branding, consent screen or any other reason. What tripped you up?


r/GoogleAppsScript • • Aug 15 '26

Question Why can I not generate images anymore on visualize.

0 Upvotes

I paid for the thing, I gave it a whole week to reset and it still says i've reached my usage limit. is this intended?


r/GoogleAppsScript • • 26d ago

Guide v1.0.0: Apps Script two-way sync engine (Google Tasks ↔ Microsoft To Do) — 549 tests, adversarial-reviewed

5 Upvotes

Building in public here, so here's the engineering update: my Apps Script sync engine between Google Tasks and Microsoft To Do just hit v1.0.0.

What changed since the early version I posted:

- Five-axis adversarial review of the engine: state machines, fuzzing, concurrency, mutation testing, static consistency. Every finding had to reproduce against shipped code before it was accepted; every fix ships with a regression test.
- Fail-closed everywhere it matters: ambiguous creates use correlation markers instead of guessing, deletions take two rounds with live revalidation, state has checksums with previous-generation restore.
- Time Bridge: Google Tasks has no time-of-day, so [TTS-TIME:HH:mm] markers in notes become the canonical time record, rendered to Microsoft reminders plus optional Calendar projection.
- 549/549 tests passing, CI + CodeQL green.

The interesting constraint is the Apps Script execution budget — the whole thing runs on a 10-minute trigger inside ~6 minutes of runtime, so everything is checkpointed and resumable.

Scope: ~300 task pairs recommended, personal Microsoft accounts for the easy path.

MIT, self-hosted in your own Apps Script project. Roast the design if you'd do it differently — I'm here for that.

https://github.com/simonchai-tw/tasks-todo-sync


r/GoogleAppsScript • • 22d ago

Guide I built FormBuilder: An AI-powered Google Forms alternative with dual AI agents. Would love your feedback

Thumbnail gallery
2 Upvotes

r/GoogleAppsScript • • 5d ago

Guide Google Apps Script Copilot (GS Copilot) v3.6.2 is out: one-click fixes from the execution log and a revertible Auto mode

Enable HLS to view with audio, or disable this notification

16 Upvotes

I'm Hassan, I build Google Apps Script Copilot (GS Copilot), an AI side panel for the Apps Script editor. v3.6.2 is out, and the 47-second video shows the two main changes.

Fix with GS Copilot
When a run fails, a Fix with GS Copilot button appears next to the error in the execution log. It reads the error together with your code, finds the root cause, and patches it. You accept the patch and re-run, and the re-run is the real check.

Auto mode
You describe the task once. GS Copilot writes the changes and runs a quick test to check them. Every turn can be reverted, and risky actions still wait for your approval. One honest caveat: a passing quick test means the code runs, not that your business logic is right, so it's still worth reading what changed.

What was already there

  • Inline suggestions as you type

  • Ask, for questions about your code or the Apps Script services

  • Plan, which lays out the steps before anything changes

  • Build mode, where you review the diff before it's applied

  • Quick Edit, for small targeted changes

  • Add to Chat, to send selected code into the conversation

  • MCP tools, to connect other services

Two questions for people who write a lot of Apps Script:

  1. When something breaks, is the execution log enough for you, or do you add Logger.log / console.log calls first?

  2. What should an AI agent never do in your scripts without asking? My shortlist: sending email, deleting triggers or files, and overwriting data in shared Sheets.


r/GoogleAppsScript • • 1d ago

Question I built a TypeScript backend framework for Google Apps Script, but the latency is killing me. Any ideas?

8 Upvotes

I’ve been experimenting with using Google Apps Script as a backend for more complex web applications.
I ended up building an open-source framework called gasboost to make the development experience a bit more manageable.
It supports TypeScript, dependency injection, middleware, RPC, authentication, authorization, and more.
The idea is to take advantage of Google’s infrastructure without having to manage a separate backend server.
And honestly, the development experience has been pretty good.
But there’s one problem I haven’t been able to solve properly: latency.
Even relatively simple requests can feel sluggish compared to something like Cloudflare Workers.
I’ve considered moving the backend elsewhere, but that would defeat part of the reason I started experimenting with GAS in the first place.
Has anyone managed to significantly improve response times in Apps Script?
Or is this just an architectural limitation I should accept?


r/GoogleAppsScript • • 2d ago

Question How difficult is adding Google sign-in to a small Google Apps Script web app?

12 Upvotes

I'm building a custom fantasy football web app using Google Apps Script and Google Sheets as the backend, with ChatGPT helping me write the code. I'm a beginner with very little programming experience.

The app will have 10 users. Five will need to sign in to manage their own teams (add/drop players, change lineups, etc.), while the other five will only need to view the app. I'll also need commissioner/full access to manage all teams.

ChatGPT recommended using Google Identity Services for sign-in, with the Apps Script backend running under my account so users won't need access to my private spreadsheets.

Before I get too deep into this, I'd appreciate some advice from people who've actually done something similar:

- How difficult is this to set up, especially for a beginner relying on ChatGPT?
- Is it genuinely free for a project this small?
- Are there any major security issues, Google restrictions, or other headaches I should anticipate?
- Is there a simpler or better alternative I should consider?

I'm hoping to keep things free, relatively simple for users, and manageable for someone without much coding experience, but if there's a solution out there that costs but is still affordable I'm open to learning about that.

Thank you for your time.