AppsScriptPulse

Totally Unscripted: How developers are shaping the future with Google Workspace and GenAI – 24 January, 2024 at 1200 PT / 1500 ET / 2000 GMT

For the next live broadcast of Totally Unscripted we will be exploring how Vertex AI and other GenAI solutions can be used to extend the capabilities of Google Workspace with targeted solutions that integrate seamlessly with Google Workspace Add-ons, Editor Add-ons, Chat apps, Drive apps, and more!

In this episode we will be joined by a panel of expert guests: Donato Meli (Workspace Go-To-Market at Google), Mohammad Al-Ansari (Developer Advocate (Partnerships) at Google), and Allen Firstenberg (Project Guru at Objective Consulting, Inc).

As always the show is broadcast live and you can ask questions via the YouTube chat, but also interested to hear in advance any of your burning questions for our panel using the comments section below.

We will be LIVE on 24 January, 2024 at 1200 PT / 1500 ET / 2000 GMT

Show Live/Recording link – https://www.youtube.com/watch?v=IPrWpV_bf4c

Google Apps Script Service Account impersonation without downloading private service account keys 

Avoid downloading private service account keys by using impersonation in Apps Script to obtain access tokens.

For Google Workspace Admins you can gain super powers (and super responsibility) using Google Cloud project service accounts. A common scenario is using service accounts with domain-wide delegation to make API calls impersonating Google Workspace users. With this you can do things like set a user’s Gmail settings including signatures, authenticate as a user in Google Chat and much more.

A quick way to use a service account is to download a JSON key. The challenge then given the potential capabilities of service accounts is securely storing the JSON key. A alternative approach, which is explained in this post by Justin Poehnelt, is using Apps Script to create and fetch a short-lived credential for your service account.

Short-lived credentials are highly recommended for applications requiring robust security and precise access control for service accounts, reducing the attack surface and the risks with accidentally exposing static secrets.

You can find out more include code snippets/setup in Justin’s post which also links to the support documentation.

Source: Apps Script Service Account Impersonation | Justin Poehnelt

Create a Google Chat Bot on your own data with Vertex AI Search and Google Apps Script

Create a Chatbot answering user questions based on your documents. RAG implementation with multiturn using Vertex AI Search and Apps Script

More GenAI, this time from Stéphane Giron looking at how Apps Script can be used to provide the glue for a Google Chat app powered by Vertex AI Search. In this example you can see how unstructured data like PDF documents can easily be uploaded to a Cloud Storage folder, which then become the knowledge base for the Chat app. The post includes a Google Apps Script snippet for sending messages to the Vertex AI Search API as well as instructions on how to create the chatbot, including how to import data into Vertex AI Search and how to integrate the chatbot into Google Chat.

The post is a great summary of what is possible when combining Google Chat and Vertex AI Search. If you are interested in finding out more about what is possible using Vertex AI Search with follow-ups Google provide a comprehensive guide.  

Source: Create a Google Chat Bot on your own data with Vertex AI Search and Google Apps Script

Google Workspace Developer News: Google Meet Web Add-ons SDK, tutorial for genAI Chat app, and more

Welcome to the second edition of the Google Workspace Developer News! Find out what’s new on the Google Workspace Platform.

I like to think I keep a close eye on Google Workspace development, but with so much happening it’s easy to miss what’s new. Here’s a really comprehensive recap put together by Chanel Greco from the Google Workspace DevRel team. As well as covering the recent release notes Chanel spotlights some additional new resources and changes worth finding out about. The episode covers:

  • 0:12 Delete versions in your Apps Script project
  • 0:35 Update to Google Chat API: User’s read state in spaces and threads
  • 1:06 Google Meet Web Add-ons SDK
  • 1:41 Directory API update (changes to ChromeOS management)
  • 2:06 Apps Script + Calendar API solution update
  • 2:20 Google Chat API update
  • 2:45 Extend the Google Workspace UI – overview page
  • 2:59 Google Drive API v3 available for Apps Script
  • 3:23 Update to the Card service
  • 4:11 Tutorial and code sample for building a genAI Chat app

Source: Google Meet Web Add-ons SDK, tutorial for genAI Chat app, and more

GenAI for Google Workspace: Exploring Gemini API Function Calling with Google Apps Script — Part 3

 

Using Google Gemini API with Google Sheets to create personalized mail merges. An exploration in generative AI ‘function calling’

Google latest generative AI solution, Gemini, includes the capability to declare functions that the LLM can use in it’s response. The response includes the name of the function and the parameters the script needs to run the function.

The function isn’t executed by the LLM, but run with your code, which creates really interesting opportunities for Google Apps Script solutions. In particular, given user identity and authorisation is an integral part of Apps Script and how it integrates with other Google services it means solutions like personalised mail merges can be created in a couple of lines of code.

Follow the source link to find out more about function calling and exploring Gemini’s capabilities with data in Google Sheets.

Source: GenAI for Google Workspace: Exploring Gemini API Function Calling with Google Apps Script — Part 3

Totally Unscripted Returns! Since We’ve Been Gone: A Recap – 10 January, 2024 at 1200 PT / 1500 ET / 2000 GMT 

WE ARE BACK!!! Totally Unscripted returns for more Google Workspace Developer community chat about new features, popular solution trends, best practices, the Google Workspace Marketplace and everything else related to Google Workspace development.

To kick off the return of Totally Unscripted for Season 5, in this episode the TU crew will take a look back at some of the more significant updates and additions involving the Google Workspace Platform “Since they’ve been gone!”

As always the show is broadcast live and you can ask questions via chat, but also interested to hear in advance any of your questions using the comments section below.

Show Live/Recording link – https://www.youtube.com/watch?v=V-Z3BcAjRKk

Automatically creating descriptions of files in Google Drive using Gemini Pro API and Google Apps Script

Gemini LLM, now a Vertex AI/Studio API, unlocks easy document summarization and image analysis via Google Apps Script. This report details an example script for automatically creating the description of the files on Google Drive and highlights seamless integration options with API keys.

In this blog post, Kanshi Tanaike shows how you can automatically create descriptions for files on Google Drive using the Gemini Pro API with Google Apps Script. The post includes a step-by-step guide on how to set up and use the Gemini Pro API by generating a key is Google AI Studio (formerly Maker Suite). There are geographic restrictions on Google AI Studio, but you can call Gemini Pro from a Google Cloud project with a little more setup (a previous post sharing Tutorial: Respond to incidents with Google Chat, Vertex AI, and Apps Script outlines a general approach for connecting Apps Script to Google Vertex AI services.)

The post includes a couple of examples showing how Gemini can be used to provide responses to both text and visual prompts. Gemini Pro is still in public preview and as Kanshi Tanaike highlights rate limiting will likely prevent putting these solutions into production just now. At this point hopefully there is enough to start experimenting with Google Workspace integrations to Gemini.

Source: Automatically Creating Descriptions of Files on Google Drive using Gemini Pro API with Google Apps Script

The Ultimate Guide: Marketing a Google Workspace Add-On

Marketing a Google Workspace Add-On is a comprehensive guide advises developers on best practices for marketing a Google Workspace add-on.

This post comes thanks to John McGowan, Automagical Apps, who has worked with ALK Digital Marketing to develop a marketing strategy for Google Workspace Add-ons. The guide has lots of useful tips for understanding the Google Workspace Marketplace and developing optimised marketing resources for the Workspace Marketplace as well as other channels including your website, social media and email marketing campaigns.

There is also some guidance on how to approach monetization of your add-on which includes balancing free rials, paid subscriptions and adaptive pricing. This will likely change dependent on the type of add-on you are creating and the value it brings to users. Follow the source link to read more..

Source: The Ultimate Guide: Marketing a Google Workspace Add-On – ALK Digital Marketing Solutions

How you can use Google Forms, AI, and Apps Script automation to analyze 1,700 survey responses (and the 1,000th AppsScriptPulse post)

This post describes how I designed and ran an audience survey with over 1,700 responses, using Google Forms, Sheets, Apps Script, and ChatGPT. I’ll show you the entire process from end-to-end, including how I:

  • Created a survey with Google Forms
  • Used Apps Script to automatically say thank you to 1,700 respondents
  • Analyzed the response data in Google Sheets
  • Used AI to help me understand the qualitative data
  • Presented the results in Google Docs

It’s rather fitting that the 1,000th Pulse post features content by the one and only Ben Collins! Back in late 2019, when I was thinking about creating a new community site for Google Workspace developers, Ben’s encouragement was the spark that ignited AppsScriptPulse.

And today’s post by Ben is a nice example of Apps Script’s power to automate repetitive tasks. As part of this he shows how to craft personalised “thank you” emails for Google Form survey response with Google Apps Script. Ben’s insights go beyond ‘thank-you’s as he outlines how he administers and analyses customer surveys, highlighting his design choices for Google Forms and data analysis using built-in Google Sheets functions.

To take things a step further, Ben also highlights how he used ChatGPT to categorize qualitative survey responses. With Google’s recent announcement of their new AI model, Gemini, which outperforms ChatGPT  in a number of academic benchmarks, it would be interesting to see how these two platforms compare for this type of analysis.

Raising a glass (or an espresso :) to Ben and this 1,000-post milestone!

Source: How To Analyze Google Forms Survey Data with AI and Apps Script

Adding charts to Google Workspace Add-on sidebar with Google Apps Script

Creating dynamic charts in the sidebar of your Google Workspace Add-on can be an effective approach to getting across a lot of meaning in a somewhat confined space. In this tutorial, we will use Google’s Chart API to generate a live chart, first from some static data and then live from an external data source like a Google Sheet. All with the help of a little Google Apps Script magic.

Here’s another great tutorial from Scott Donald which provides a detailed tutorial for including charts in a Google Workspace Add-on using the Card Service. The tutorial covers how you can embed dynamic chart data from a Google Sheet. Whilst targeted at Google Workspace Add-ons (Gmail and Drive) you should be able to easily modify this for cards used in Google Chat. The source tutorial includes a video giving an overview of the solution and if you want to take this project further you can signup for Scott’s Create and Publish Google Workspace Add-ons with Google Apps Script: Master Class.

Source: Adding Charts to Google Workspace Add-on Sidebar Apps with Apps Script – Yagisanatode