AppsScriptPulse

Introducing ChatGPTApp, a new library for Google Apps Script and ChatGPT (and a new way to generate personalised mail merges)

Last month, OpenAI announced Function calling, “a new way to more reliably connect GPT’s capabilities with external tools and APIs”. Super useful ❤️ and we decided to integrate that with Google Apps Script.

Following on from yesterday’s Pulse post which highlighted Ben Collins reflections on ‘What can AI do for you as a Google Sheets user? Is the hype justified?’, here is a contribution from another Apps Script expert, Romain Vialard, announcing a ChatGPT library for Google Apps Script.

The source post highlights a number of examples, including the standard ‘prompt’ calling. Where this post gets very interesting is integration with Open AI’s function calling features:

In an API call, you can describe functions to gpt-3.5-turbo-0613 and gpt-4-0613, and have the model intelligently choose to output a JSON object containing arguments to call those functions. The Chat Completions API does not call the function; instead, the model generates JSON that you can use to call the function in your code.

To illustrate this below is a screenshot of a very slightly extended example, which has a Google Sheet with the headings email, name and tip topic. The functions are described to ChatGPT and in the case of sendMessage() the parameters it requires. The ChatGPTApp library handles the functions and in the case of the getContactsList() uses it to pass the Google Sheet data for ChatGPT to format a JSON response to correctly call the sendMessage() function.

I found it took me a while to start understanding what is going on and would recommend experimenting with the library and sample code to get a sense what is possible.

Source: Introducing ChatGPTApp, a new library for Google Apps Script

Process only selected Google Sheets rows in Google Apps Script – The Mergo and Publigo Google Workspace Add-on solution

If you selected 1 or more rows, Publigo lets you generate a personalized document for those rows only or all visible rows in your sheet. Image credit: Romain Vialard

It is super easy in Google Sheets to select only specific rows, even if they are not adjacent. Simply hold down the CTRL / command key while making your selections. And those selections are also available in Google Apps Script via the method getActiveRangeList() … For Google Apps Script developers, here is a quick snippet showing how to process only selected rows.

Following the previous Pulse post on Get all selected Ranges in Google Sheets Romain Vialard got in touch to highlight the approach they have implemented to include this feature in the Mergo and Publigo Google Workspace Add-ons. This source post from Romain includes a snippet of code which might be useful for other Google Apps Script developers.

Source: Process only selected rows in scripts and add-ons

Deploy easily with the new Google Apps Script IDE

A week ago Google announced the availability of an improved code editor for Google Apps Script. … In this article, I’ll focus on the changes related to Versions and Deployments in Apps Script.

Post from Romain Vialard unpicking deployments with the new Apps Script IDE. Romain highlights lots of very useful tips and things to be aware of when deploying Apps Script projects, in particular:

For existing scripts, deploying from the new IDE will create a new deployment with a different url for your web app

Source: Deploy easily with the new Google Apps Script IDE

Google Slides API — a deep dive on its powerful image manipulation methods

A post dedicated to devs and highlighting the power of the Slides API.

Use Google Apps Script and the Google Slides API to create a card game like Dobble.

Source: Google Slides API — a deep dive on its powerful image manipulation methods

Make your own Dobble / Spot It game with Google Slides and Apps Script

Upload a few images to Google Drive, press a trigger to start a little Apps Script code and get your own Dobble game on Google Slides.

This tutorial will guide you into creating your own Dobble card deck with Google Slides, which you can easily print for use in your day to day life.

Source: Make your own Dobble / Spot It game with Google Slides and Apps Script

What’s behind the numbers in the G Suite Marketplace?

Awesome Table has recently joined the very exclusive club of apps that have reached the 10M user milestone on the G Suite Marketplace, like Lucidchart. Perfect time to give a bit more visibility on this number of users and follow-up on my article Add-ons and the Google Apps Marketplace from 2016.

Source: What’s behind the numbers in the G Suite Marketplace?