We’ve been a little remiss highlighting the latest Google Apps Script release notes, but in case you missed it there has been an update to the V8 runtime:
You can now call functions in separate files before they’re parsed. Previously, the V8 runtime required a script file to be parsed before any other file could call the functions it defines.
Now, the order of files in the Apps Script editor doesn’t matter. This means that you can call a function in a different file to assign a value to a global variable—the function is always defined before it’s called. This behavior reflects that of the legacy Rhino runtime.
See the source post for more details and an example code snippet.
When working in a team and/or with a client, you want to have multiple environments. At minimum, you probably want a dev environment (or multiple ones) in which you are working, and a test environment in which the client or your team can run acceptance tests before production. Of course, they must both be separate from the production environment. To push your code to the correct environment, you need to either update the
file manually or keep multiple copies of your script with different
files. Fortunately, things have just become significantly easier, as I recently built an app for this purpose called
clasp-env, which is available on NPM. See the source link for details.
Convert selected range into PNG image and save it to Drive
In this post from Max Makhrov you can discover how you can convert a selected Google Sheets range to an image. With options to embed charts and tables in Google Docs and Slides you might be asking why you would want to do this. Max highlights a couple of great reasons:
You need to create a screenshot and use it later: send it to Telegram or email, or use it in Slides.
You want to create an image of cells as you see them on screen, containing images, charts, sparklines, etc.
You want to create a screenshot of a range that does not fit your screen.
You want to create a screenshot of a range with high resolution.
There are some limitations with this approach which are outlined in the post and if you have any solutions there is a link to contribute to the GitHub repo.
Learn how to track link clicks using Google Sheets and Apps Script to create a simple, lightweight tracking system
You live and learn! This is a regular occurrence if you are a subscriber to the work of Ben Collins (benlcollins.com). No exception with this recent post highlighting the
attribute which can be used in
HTML links. This attribute has been around for a long time, but I’m sure many people like have never come across it. In the source post from Ben you can learn how to setup an Apps Script web app which will let you record link clicks in a Google Sheet.
Preview tweets and user data when sharing links, along with the ability to follow a specific user or like a particular tweet.
If you haven’t looked at Google Chat apps or not looked at Chat apps for a while this is a great post from Sourabh Choraria outlining the development process using Google Apps Script. As part of this Sourabh includes an overview and source code for a Twitter powered Chat app recently published and available to try out in your Google Workspace domain. The app showcases slash commands as well as a recent new feature of preview links.
Another useful discovery from Kanshi Tanaike this time highlighting the ability to use markdown in Google Apps Script code comments. For those unfamiliar, JSDoc is the syntax used to automatically generate inline documentation in Google Sheets custom functions,Libraries as well as function references in your script project. As highlighted in the post as well as being able to add
tags, developers can use markdown syntax to provide additional formatting to documentation comments. See the source post for details of supported markdown syntax.
🏝 It’s finally summer break! We all wish we could create Out Of Office events in Calendar using Google Workspace #AppsScript (I know you do). But Calendar API is yet not allowing us to do so.
This post from Dararath BEAUVOIR is a great reminder that in Google Workspace/Apps Script development that you occasionally need to look beyond the built-in services like
to the Advance Service equivalents. In this case
is used because unlike
using the Advanced Service the event response indicated if the
is out-of-office. More details are included in the source post.
Forms History is a Google Workspace Add-on that allows you to monitor your version history and store copies in Google Forms
Not just talking the talk, but also walking the walk. Shortly before taking a new role at CTS, the largest dedicated Google Cloud Partner in Europe, I published Forms History an add-on to enable revision history functionality in Google Forms.
Fellow Google Developers Expert, Scott Donald, has picked this up in the latest episode of GWAOw! his dedicated to Google Workspace Add-on review show. You can follow the source link for the YouTube clip and more. As part of the episode Scott rightly highlights the creative work of Alice Keeler, which hasn’t just included artwork but Alice has also provided a huge amount of support in promo and usability.
This is a sample script for retrieving the values of dropdown list of the smart chips on Google Document using Google Apps Script.
At August 23, 2021, 3 Classes for retrieving the smart chips have been added to Google Apps Script. But, in the current stage, unfortunately, all values of the smart chips cannot be retrieved by the Classes. For example, the dropdown list of the smart chips cannot be retrieved
Incredibly useful report and workaround from Kanshi Tanaike for Google Workspace Devs needing to get some ‘smart chips’ values from Google Docs. Hopefully classes/methods will be added to Apps Script and the Google Docs API (here is a related feature request you can star in the issue tracker), particularly as the current solution is to convert the Google Doc to .docx and then back to Google Doc.