AppsScriptPulse

Google Chat developer platform release notes – new Chat APIs generally available

Video credit: Pablo Felip Monferrer / @pfelipm

Build Chat apps that bring your services and resources right into Google Chat, letting users get information and take action without leaving the conversation.

Google has been spending a lot of effort recently adding features to Google Chat. This just hasn’t been limited to the user interface and Google recently announced a long list of new Chat API methods are now generally available. For Google Workspace developers and administrators this opens up more opportunities to manage chat messages, spaces and membership.

For Apps Script developers I think it’s unlikely you’ll see a ChatApp or a Chat Advanced Service, but with an OAuth2 library you’ll be able to make calls to the Chat REST API. With the new Google Chat API methods comes the ability to access user data and perform operations on the authenticated user’s behalf. I don’t think it will take long before we see example solutions appearing from the community and given this video from Pablo Felip Monferrer I’ll be keep a close eye on his blog pablofelip.online.

Source: Google Chat developer platform release notes  |  Google for Developers

Generate and send PDFs from Google Sheets with Google Apps Script 

Automatically create PDFs with information from sheets in a Google Sheets spreadsheet. Once the PDFs are generated, you can email them out directly from Sheets. This solution focuses on creating custom invoices, but you can update the template and script to fit your needs.

Today as part of a customer Google Apps Script introduction workshop, we covered a basic invoice / PDF example. By coincidence this month’s Google Workspace Developers Newsletter highlighted a solution spotlight from the Apps Script samples catalogue which does something very similar.

A trick I learned today from our Lead Workspace Trainer, Tim McLardy, was rather than using UrlFetchApp to get a PDF version of the Google Sheet with the export/?format=pdf url, is instead getting the Google Sheet as a blob and creating a pdf with DriveApp.createFile(). As this technique will generate a PDF with pages with all your Sheet tabs the trick is to selectively hide all but the tabs you want in your PDF. In the case of the example linked as the source post you can rewrite the createPDF() function as:

/**
 * Creates a PDF for the customer given sheet.
 * @param {string} ssId - Id of the Google Spreadsheet
 * @param {object} sheet - Sheet to be converted as PDF
 * @param {string} pdfName - File name of the PDF being created
 * @return {file object} PDF file as a blob
 */
function createPDF(ssId, sheet, pdfName) {
  // Based on https://webapps.stackexchange.com/q/162155/30021
  const ss = sheet.getParent();
  const sheets = ss.getSheets();
  // Hides all sheets that are not the main one
  sheets.forEach(s => {
    if (s.getSheetName() !== INVOICE_TEMPLATE_SHEET_NAME) {   
      s.hideSheet()
    }
  });
  
  // make a pdf of the sheet
  const folder = getFolderByName_(OUTPUT_FOLDER_NAME);
  const pdfFile = folder.createFile(ss.getBlob()).setName(pdfName);
  
  // show all the sheets
  sheets.forEach(s => s.showSheet())
  return pdfFile;
}

Source: Generate & send PDFs from Google Sheets  |  Apps Script  |  Google Developers

A tool for exploring and testing Google Workspace APIs

Image credit: Google

We recently launched the Google Workspace APIs Explorer, a new tool to help streamline developing on the Google Workspace Platform. What is this handy tool and how can you start using it?

The Google Workspace APIs Explorer is a tool that allows you to explore and test Google Workspace APIs without having to write any code. It’s a great way to get familiar with the capabilities of the many Google Workspace APIs.

The Google Apps Script editor bakes in some nice features including inline documentation to help when you are coding your script project (and if you don’t already know, next time you are in the online script editor press ctrl + space :). To help with discovery Google have recently published the Google Workspace APIs Explorer website, which lets you see and test a range of Google APIs. For Google Apps Script developers this site is a great way to help you understand how you can use the Advanced Services (my tip for Workspace admins is to check out the Directory and Report API which as part of the Admin SDK API Advanced Service).

Source: A Tool for Exploring and Testing Google Workspace APIs

 

Google Workspace Developers ‘ask me anything’ and the future of Apps Script #AppsScriptAMA

The Google Workspace DevRel team have recently kicked off an ‘ask me anything’ #AppsScriptAMA campaign on Twitter:

You can find recent questions/answers using this Twitter search. There was one answer that caught my eye from @mtfan about the future of Google Apps Script:

The YouTube short response doesn’t give much away in terms of big feature updates, but the long waited Apps Script project version control sounds like it might be arriving soon.

Build your first AppSheet app: How I built a food tracker (with AppSheet Databases)

I keep forgetting what I have in the freezer. At first I used Google Sheets to keep track of it, but I wanted something that was easy to consult and update on my smartphone. So I turned to AppSheet! Here’s a tutorial to follow to make a similar tracking solution.

This post on the Google Developers blog covers the basic steps for creating an AppSheet app using AppSheet Databases, which are currently in public preview. I’ve recently also been having a play with AppSheet Databases, and I’ve been impressed with the improved performance whilst also keeping them simple to use. I’ve encountered a some issues when setting up columns as references so not ready for prime time yet. Projects like the one mentioned in this post are a great way to ‘kick the tyres’ and experience yourself.

Source: Build your first AppSheet app: how I built a food tracker

Google Workspace Developer Summit – Toronto and Chicago March 9 & 14, 2023 

Calling all #GoogleWorkspace Developers! The Google Workspace Platform team will host two Developer Summits at Google Toronto (March 9th) and Google Chicago (March 14th).

The Google Workspace Developer Relations team are on the road again with their latest Developer Summit. This time the team will be hitting Toronto and Chicago. The events are a great opportunity to discuss the Google Workspace platform vision, meet other Google Workspace developers and visit one of the Google offices. Attendance is free and you can find out more about the event and register your interest to attend via the source link.

Source: Google Workspace Developer Summit – Toronto and Chicago

How AppSheet reached new heights in 2022 as part of Google Workspace

Image credit: Google

As the way we work continues to change, the need for no-code and low-code tools that enable hybrid work and empower the workforce across all industries is on the rise. The democratization of software creation is also gaining ground within organizations, and by 2024 more than 65% of applications will be developed by low-code tools.

I was late to AppSheet, my journey only really starting in May 2022. Like all platforms, even no/low-code, there is a bit of a learning curve to get your head around how it works, but once you do there is a world of opportunities for a wide range of users. Even for seasoned developers features like the Apps Script integration and AppSheet API mean there is plenty of scope to extend the capabilities of AppSheet.

This post from Google provides some useful reference cases, evidencing the impact the platform has had on a range of customers as well has highlighting some recently developments in the AppSheet platform including the opportunity to deploy AppSheet powered Google Chat apps.

At CTS, where I work, we have a range of services to support AppSheet adoption ranging from hackathons, training and development. Feel free to get in touch if you would like to find out more.

Source: How AppSheet reached new heights in 2022 as part of Google Workspace | Google Workspace Blog

Announcing: AppSheet Chat Apps now available to preview program!

We’re happy to announce that AppSheet-powered no-code chat apps are now available in preview for Workspace customers in AppSheet!

You can access this feature right now if you are in the Preview Program, and you can provide any feedback in this thread. If needed, additional information can be found in our help center articles. We’re targeting a full launch for later this year.

I’ve been spending a fair bit of time in Google’s ‘no-code’ platform AppSheet. Even for developers there is plenty to get your teeth into with features like Apps Script integration. One of the incredibly powerful core features of AppSheet is the ability to send dynamic emails which include forms designed in AppSheet. These allow users to interact with your app without leaving their inbox.

Whilst the inbox dominates in many business sectors, support for frontline workers increasingly leans on other communication channels including Google Chat. With the announcement of AppSheet powered no-code Google Chat apps there is now an opportunity to also push dynamic forms, send data and interact with Chat users in that space. For developers there is also the opportunity to do even more with the Apps Script integration. Follow the link to the announcement post to find out more…

Source: Announcing: AppSheet Chat Apps Now Available to Preview Program!

Apps Script has deprecated the Contacts service. Instead, use the People API advanced service | Release Notes | December 16, 2022

Apps Script has deprecated the Contacts service. Instead, use the People API advanced service. Refer to Migrate from Contacts service to People API advanced service.

Having taken bit of a break from Pulse over the festive period I had missed the December release note announcing the deprecation of the Contacts service, ContactsApp. There isn’t much time to update your code as the service will no longer function after April 30, 2023. Google have however provided detailed guidance on migrating from Contacts service to People API advanced service.

[HT to Pablo Felip @pfelipm for flagging this update on Twitter]

Source: Release Notes  |  Apps Script  |  Google Developers

Highlights from the Google Workspace Developer Summit 2022 – The state of Workspace development is good!

Busy old couple of weeks at CTS and it’s been nice to get back to some face-to-face events. Last week I had the pleasure of joining the Google Workspace DevRel team on stage at the Google Workspace Developer Summit, London co-presenting with some guy called Charles Maxson.

A couple of years ago as part of Totally Unscripted we did a ‘State of Script‘ episode with then Apps Script PM Keith Einstein. This latest clip from the Google Workspace Developer YouTube channel captures not just the state of script, but the wider state of Workspace Dev.

The clip is worth a watch to get a summary of some of the new features coming to Workspace development. For me, not only is there plenty to get excited about my overall feeling from the Summit was Workspace development is now a first class citizen in the Google Cloud family. The state of Workspace development is good!

Source: Highlights from the Google Workspace Developer Summit 2022!