AppsScriptPulse

Ever felt like you’re bringing a knife to a gunfight? That’s me coding without `console.table()` in Google Apps Script. Here’s what I did about it.

Here’s the scoop: While tinkering with a project, I needed a way to pinpoint the last row of data in various sheets — essentially to catch any “orphan” values lurking there. Typically, something like console.table() would be the hero of the day, allowing me to effortlessly display data like so:

| Sheet Name | Last Row |
| ---------- | -------- |
| Sheet1     | 513      |
| Sheet2     | 27       |
| Sheet3     | 50       |

But as fate would have it, Google Apps Script doesn’t include a console.table() function, or even a Logger.table()

Source: Ever felt like you’re bringing a knife to a gunfight? That’s me coding without console.table() in Google Apps Script. Here’s what I did about it.

Totally Unscripted – What’s new in the AppSheet world? A chat with AppSheet Engineering Lead Mike Procopio May 01, 2024 at 1200 PDT / 1500 EDT / 1900UTC / 2000 BST


AI is changing everything and AppSheet is no exception! In this episode, we will welcome Engineering Lead Mike Procopio from the Google AppSheet team to hear how AI is driving innovation, enabling assisted app development, automated insights, smart workflows, and more! So whether you are no-code, low-code or “what’s code?”, join us to find out what the future holds for AppSheet for building powerful, intelligent apps with Google Workspace

In the next episode of Totally Unscripted*, we will welcome Engineering Lead Mike Procopio from the Google AppSheet team. Mike has in-depth knowledge of Google Workspace, you can thank Mike for simpler file upload in Google Drive launched in 2011.

As part of the session we will be asking Mike about implementing lightweight governance strategies using AppSheet policies, ensuring security and control while enabling creativity and fostering a thriving citizen development culture.

We’ll also take a look at some of the new features that are coming soon to AppSheet, including a new admin console which will be available to Core and Enterprise customers for monitoring app usage, manage user roles, and refine governance policies, as well as AppSheet’s new Google Forms integration which will soon be in public preview.

Finally, and not least, we will explore how you can harness the power of AI in AppSheet, looking at the latest AI features, including AI-assisted app creation and the “extract” capability with Gemini, to streamline development and enhance functionality.

You can join the live stream on YouTube and ask your own questions for Mike during the session. If you miss the live event, you can always watch the recording on the same link: https://www.youtube.com/watch?v=N3Rl7DTekMM

*Totally Unscripted is an independent Google Workspace developer show co-hosted by Martin Hawksey, Charles Maxson, Alice Keeler and Kara Ireland

The Ben Collins ‘Google Sheets Tips Weekly Email’ hits issue 300 – Get actionable tips direct to your inbox

Join this community of over 53,600 data analysts and Google Sheets aficionados and get an actionable Google Sheets tip every Monday

With a weekly subscription of over 50K we probably don’t need to flag a ‘Monday morning espresso’ of Google Sheets tips from Ben Collins as you are probably already subscribed. However, given Ben recently published the 300th issue it’s a milestone worth celebrating and a chance to say ‘thank you’ to Ben for this invaluable publication.

As eloquently demonstrated on a recent episode of Totally Unscripted, Ben is the Google Sheets “King of Functions”. Ben’s expertise isn’t limited to solving Google Sheet challenges, he’s also a master at explaining his thinking and helping other people learn. If you haven’t subscribed to Ben’s newsletter follow the source link (it’s free!) and check out Ben’s website for loads of great tips and resources.

Source: The Google Sheets Tips Email – Get actionable tips direct to your inbox

Google Apps Script workflow solution for simplifying date tracking in Google Sheets


Template for a workflow to track tasks that follow steps. It can alert on due and expired steps per each task, while also navigating to alerted cells with a single click. It also demonstrates the use of conditional rules and ARRAYFORMULA.

Sig Mandel has created this clever Google Apps Script solution which might be suitable for anyone struggling to manage tasks and deadlines in Google Sheets. This template lets you easily configure overdue and upcoming deadlines, letting you jump directly to problem areas with a click. It also cleverly uses conditional formatting and ARRAYFORMULA to streamline your task tracking.

You can use the provided Google Sheets template as a starting point and add your workflow steps as columns, input your tasks, and the sheet takes care of the rest. You can also use a number of other features including real-time “toast” messages, a  dynamic installation menu for easy setup, and optimized code for smooth performance.

You can find the template and instructions in the source link or join in the conversation on LinkedIn.

Source: GitHub – zmandel/workflow-apps-script

Google Apps Script: google.script.run vs. doGet/doPost Endpoints

Learn about the different options for making API calls in Google Apps Script web apps: `google.script.run` and GET/POST endpoints (`doGet` and `doPost`). Understand their strengths and weaknesses to choose the best approach for your project.

Google Apps Script web apps are a popular way to publish user interfaces for automation processes. I’d never really considered the decision between google.script.run and GET/POST endpoints (doGet and doPost) when making server side calls, but as outlined in this post from Justin Poehnelt there are scenarios where both of these approaches might be most appropriate. Justin also provides some useful code snippets to help you get started with both methods. Follow the source link to read more…

Source: Google Apps Script: google.script.run vs. doGet/doPost Endpoints | Justin Poehnelt

Google Apps Script gets a public knowledge base of Github projects with Gassypedia

All the Google Apps Script related github activity is now on Google Bigquery and Google Looker. Here’s how it was done.

Bruce Mcpherson has recently revisited his work on the visual Google Apps Script explorer tool, scrviz. Bruce has been working diligently to address limitations with the Github API and overcome quota restrictions. This new iteration still allows users to explore Google Apps Script projects and creators, but this time through a shared Looker Studio dashboard. The underlying dataset has also been made available on BigQuery if you would like to do your own analysis.

Follow the source link to find out more and explore the data!

Source: Gassypedia – public Google Apps Script on Github – Desktop Liberation

Avoiding Google Apps Script onFormSubmit simultaneous executions when unlinking/linking Google Sheet responses

Caution when using onFormSubmit triggers to avoid mass simultaneous executions when un/linking a Response Sheet.

The following post is a caution around onFormSubmit triggers after I recently discovered a way that somebody had inadvertently managed to execute my code simultaneously over 253 times. Now unless a Google Form is submitted by 253 individuals all at the same time … then this is baffling.

When should an onFormSubmit trigger run?
At the point when a Google Form has been completed and the ‘Submit’ button pressed.

How else can the trigger be activated?
Well … it turns out when you unlink and then link back a Google Response Sheet containing the onFormSubmit trigger, it will activate it for every single Form response collected up to that point in time …

Source: The Gift of Script: onFormSubmit Trigger simultaneous executions

Totally Unscripted – Apps Script and Gemini Next ’24 Redux: Build custom AI-powered Google Workspace solutions April 17, 2024 at 1200 PDT / 1500 EDT / 1900UTC / 2000 BST

Join the TU team* as we delve into the world of custom generative AI solutions for Google Workspace using Apps Script. Discover how developers are seamlessly integrating Gemini’s large language models to revolutionize productivity and automation. We’ll explore real-world examples demonstrating how AI can supercharge your Workspace experience. Imagine having Gemini as your Apps Script coding assistant, intelligently naming untitled documents, crafting next-generation mail merges, and so much more.

Get ready to learn, be inspired, and unlock the full potential of intelligent automation within Google Workspace.

Join us LIVE on April 17, 2024 at 1200 PDT / 1500 EDT / 1900UTC / 2000 BST

*Totally Unscripted is an independent Google Workspace developer show co-hosted by Martin Hawksey, Charles Maxson, Alice Keeler and Kara Ireland

Answer questions based on Google Chat conversations with a Gemini API powered Chat app

This tutorial shows how to make a Google Chat app that answers questions based on conversations in Chat spaces with generative AI powered by Vertex AI with Gemini. The Chat app uses the Google Workspace Events API plus Pub/Sub to recognize and answer questions posted in Chat spaces in real time, even when it isn’t mentioned.

Here is another great tutorial from the Google Chat DevRel team, this time showcasing how the Google Workspace Events API and some new Google Chat UI elements can be used to turn a Chat space into a Gemini Pro powered knowledge base.

The sample solution will let you consume your Chat space message history into a Firestore database. The Chat app is an intelligent agent that can then monitor for new questions and make suggestions using Gemini to generate content based on the previous messages.

There is quite a bit of setup required as part of this tutorial, but it provides a solid foundation for quickly scaling this to your needs.  A demonstration and explanation of the sample app was given as part of the Google Chat apps and APIs: Build connected workflows for the hybrid workplace session at Google Cloud Next and a recording might be available soon!

Source: Answer questions based on Chat conversations with a Gemini AI Chat app  |  Google Chat  |  Google for Developers

How to access secrets from Google Secret Manager using Google Apps Script

This detailed guide explains how you access your passwords, API keys and other sensitive data stored in the Google Secret Manager with Google Apps Script.

API keys and other credentials are your digital passports to access valuable data and services from various online platforms. When you’re developing Google Apps Script projects that connect to using keys, it’s of paramount importance to handle these keys with care and prevent them from falling into the wrong hands. Mishandled API keys can lead to unauthorized access, data breaches, and potentially even financial consequences.

One way to store API keys in Google Apps Script is the built-in Properties Service. This service offers a mechanism to store key-value pairs attached to your Apps Script project. While the Properties Service offers a convenient way to store sensitive data, it comes with limitations:

  • Not True Encryption: The Properties Service stores data in a readable format. Anyone with sufficient access to your Apps Script project might be able to view the API keys.
  • Limited Access Control: It’s challenging to implement fine-grained access restrictions over who can see the stored keys within the Properties Service.

For a more secure and scalable approach you might consider using Google Cloud’s Secret Manager. As described by Amit Agarwal in this source post:

Google Secret Manager is a cloud service where you can store sensitive data such as passwords, database credentials, encryption keys or any other confidential information that you don’t want to hardcode in your application’s source code. You can also set up an expiration time for the secret and the Google Secret Manager will automatically delete the secret after the specified time.

You can read more about using the Google Cloud Secret Manager in Amit post, which also includes the setup and Apps Script code snippets to make it work. For some general best practices on key management, Google provide this support article.

Source: How to Access Secrets from Google Secret Manager using Apps Script – Digital Inspiration