AppsScriptPulse

Register for Google Workspace Developer Summits in Boston and Berlin, September 2024

The Google Workspace Developer Summit is a full day event led by the Google Workspace Developer Relations team. Together, we will explore both the opportunity and the technologies that make up the Google Workspace platform, with a focus on what’s new and emerging in the types of solutions you and your teams can build.

The Google Workspace Developer Summit are returning! These are excellent opportunities for Workspace user and developers of all experience levels to learn about creating unique solutions for their businesses or the world. The full-day events, led by the Google Workspace Developer Relations team, will allow you to explore both the potential and technologies of the Google Workspace platform.

The events also include sessions from community members and I will be doing a short session at the Berlin event on Empowering Google Workspace Developers with Gemini Function Calling and more!

You can register to attend following these links:

If you can’t join in-person for the summits but still would like to watch some of the sessions both registration pages include a Google Form to note interest.

Source: Google Workspace Developer Summit – Boston & Google Workspace Developer Summit – Berlin

Sharing cache data between Google Apps Script projects with bmCacheSharer

Shared cached data between multiple scripts with this enhanced Apps Script Cacheservice library

Bruce Mcpherson has shared a new Apps Script library, bmCacheSharer, which enables sharing of cache data between multiple Google Workspace projects. The library was originally created to solve the problem of sharing configuration data stored in a Google Sheet with multiple script projects.

The library includes a number of nice features to overcome some of the limitations of the Apps Script CacheService, such as the 100k maximum item size and the 6-hour expiration limit by incorporating features like compression, key digestion, and automatic refresh.

It also provides options for sharing cached values by using community keys. The library is designed to be flexible, allowing users to either use its built-in cache service or provide their own. Additionally, it offers a memory cache for faster access within the same script instance. The document includes code examples and explanations to illustrate the library’s usage and benefits.

Follow the source link to find out more..

Source: Google Apps Script CacheSharer library

Totally Unscripted – Stop clicking, start Apps Scripting; The case for automating Google Workspace for EVERYONE! June 12, 2024 at 1100 PDT / 1400 EDT / 1800UTC / 1900 BST

To wrap up the first half of season 5, the Totally Unscripted crew will go back to basics and talk about the perhaps the best-kept secret in the Google Workspace universe, and that’s of course Google Apps Script! While many of our regular viewers surely know how powerful Apps Script can be, we wanted to ask the rest of the Workspace world “Why aren’t you Apps Scripting?!?”

Join us for a fun and whimsical exploration of Google Apps Script, where we’ll uncover why Apps Script is the ultimate productivity sidekick, ready to rescue you from repetitive chores and unleash your creative superpowers. No coding experience? No problem! We’ll break it down in a way that’s easy to understand, even if you’re a tech newbie.

It’s time to unlock the full potential of Google Workspace and join the Apps Script revolution. Let’s spread the word and empower everyone to automate their way to a more productive and joyful work life!

Join us LIVE on June 12, 2024 at 1100 PDT / 1400 EDT / 1800UTC / 1900 BST

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

How to use Google Apps Script to automate your Gmail out-of-office message

As a Developer Advocate for Google Workspace, I live and breathe productivity tools. But even the most tech-savvy among us can have frustratingly simple oversights. My recurring pain point? Forgetting to turn on my Gmail vacation responder to automatically notify people of my absence before heading out of office.

Google Workspace Developer Advocate, Chanel Greco, has shared a clever solution to automate their Gmail out-of-office notification using Google Apps Script. Faced with the recurring problem of forgetting to set up the out-of-office notification, Chanel crafted a script that does the job based on Google Calendar events marked as ‘outOfOffice’.

Chanel’s project not only solves a personal problem but also demonstrates the benefits of Google Apps Script for task customization and productivity. By harnessing the power of Workspace APIs, you can create innovative solutions to automate routine tasks and streamline workflows.

Follow the source link to read more…

Source: How I Used Apps Script to Never Forget My Gmail Vacation Responder Again

Build a Google Drive Add-on with Gemini to rename Untitled Google Docs – Name with Intelligence

Google Workspace Add-on for Google Drive, which uses AI to recommend new names for the selected Doc in Google Drive by passing the body of the document within the AI prompt for context.

Tired of staring at “Untitled document” in Google Drive? At Google Cloud Next ’24 and I/O 2024, the Google Workspace DevRel team showcased new Apps Script samples utilizing the Gemini API for AI-powered functionality.

One such sample, “Name with Intelligence” by Charles Maxson, helps developers overcome this common hurdle. This Google Drive add-on leverages the Gemini API to suggest relevant titles for your documents, saving you valuable time and effort.

This innovative Google Drive add-on tackles the common struggle of naming untitled documents. It utilizes the Gemini API to analyse the content of your Google Doc and suggest relevant titles based on its understanding of the text. This not only saves you time brainstorming titles, but also ensures your documents are clearly named for easy searchability later.

Want to see it in action? Check out this clip from Charles’ TU5.8 – Apps Script and Gemini Next ’24 Redux presentation.

Ready to give “Name with Intelligence” a try?

Head over to the GitHub repository to explore the source code.

For those interested in my GeminiApp library, you can also find the sample here.

Take Your Development Further

This is just a glimpse of what’s possible with the Gemini API and Apps Script. With a little creativity, you can develop your own AI-powered Google Workspace add-ons to streamline your workflows and boost your productivity.

I encourage you to experiment and create innovative solutions that enhance your Google Workspace experience!

Source: apps-script-samples/ai/drive-rename/README.md at main · googleworkspace/apps-script-samples

A comprehensive look at key value store options in Google Apps Script

A comparison of key-value store options in Google Apps Script, including PropertiesService, CacheService, Firestore, and Sheet Developer Metadata.

Justin Poehnelt has shared a comprehensive look at key-value store options in Google Apps Script. Key-value stores are useful for storing data like user preferences or frequently accessed data, which can also be shared between script executions.

As part of Justin’s post as well as looking at the built-in store options, PropertiesService and CacheService, there is also a look at scenarios where you might want to consider alternatives like Firestore.

The choice of key-value store depends on factors like expiration needs, number of items, value size, access control requirements, latency sensitivity, and cost considerations. Justin’s post provides a thorough analysis of each factor, including latency comparisons.

Head over to the source link to get all the details!

Source: Key Value Store Options in Google Apps Script | Justin Poehnelt

How to easily add the same Custom Menu to Docs, Sheets, Slides and Forms with Google Apps Script

Use Google Apps Script to create a custom menu that will work inside Google Sheets, Google Docs, Slides and Google Forms.

Tired of writing separate code for custom menus in Docs, Sheets, Slides, and Forms? This nifty Google Apps Script snippet by Amit Agarwal helps you build a universal menu that works across all these apps!

The solution is a small snippet which detects the context to see which of DocumentApp, SpreadsheetApp, FormApp, SlidesApp are available which then lets you switch to get the appropriate .getUI() method.

Check out the source post for the full code and streamline your add-on development!

Source: How to Add a Universal Custom Menu to Multiple Google Workspace Apps – Digital Inspiration

Google Forms automation with AppSheet, automatic emails and reminder with ease

Power of Google Forms with Power of AppSheet make Forms automation super easy and efficient.

Following our TU Special on building AppSheet automations using the new Google Forms integration, Stéphane Giron shared a Medium post detailing a couple of example use cases. In the post, Stéphane shares some intermediate examples that go beyond the basics, with the potential for conditional routing and advanced automations.

If your automations are not being triggered by Google Form submissions, Pablo Felip’s tip is it could be because your Google Workspace Admin has turned on AppSheet Core Security.

Source: Google Forms automation with AppSheet, automatic emails and reminder with ease

Move files uploaded with Google Forms to specific folders in Google Drive with Google Apps Script

Learn how to move uploaded files from Google Forms to a specific folder in Google Drive. You can also rename the files based on the form responses

Amit Agarwal, the brains behind Digital Inspiration’s Document Studio must have one of the most feature full Google Workspace Marketplace Add-ons. I also like Amit’s approach of sharing how you can solve problems like moving Google Form file uploads using Document Studio as well as providing an Apps Script snippet if you would like to manually code it.

In this example some setup is required to specify a folder ID and create an onFormSubmit trigger. After this the script then retrieves uploaded files from the form response, creates a subfolder named after the unique Response ID, and moves the files into that subfolder within the specified parent folder. This provides a structured and organized way to manage file uploads from Google Forms.

Follow the source link to read more about this script solution and about Document Studio.

Source: How to Move Files Uploads from Google Forms to Specific Folders in Google Drive – Digital Inspiration

Allowing access for IMPORTHTML, IMPORTDATA, IMPORTFEED, IMPORTXML, and IMPORTRANGE on behalf of the user in Google Sheets

Image credit: Kanshi Tanaike

In February 2024, Google made a change in Google Sheets to enhance data security. Now, users must provide explicit consent before Sheets can connect to external data sources. This change aims to prevent unintentional data leaks and improve overall data loss prevention within Google Sheets.

Impact on Users:

When manually adding or editing certain IMPORT functions (IMPORTHTML, IMPORTXML, IMPORTFEED, IMPORTDATA) and the IMAGE function in a Google Sheet, a warning banner will appear blocking sending a receiving data until the user gives consent. To enable this functionality, users need to click “Allow access.”

Impact on Developers:

As highlighted in the first source post by Justin Poehnelt, this change caused issues for developers who programmatically create Google Sheets and automate tasks, such as generating PDF documents  as the IMPORT and IMAGE functions were blocked.

Solutions for Developers:

Fortunately, Google introduced an update to the Google Sheets API to address this challenge. Developers can now enable external data access programmatically by setting the importFunctionsExternalUrlAccessAllowed property in the Google Sheet metadata. This allows specific IMPORT and IMAGE functions to work without manual user consent.

For the IMPORTRANGE function, a similar API property is currently unavailable. However, an unofficial workaround exists that involves calling an undocumented endpoint using Google Apps Script as detailed in the second source post by Kanshi Tanaike.

Future Expectations:

As Google continues to prioritize data security, there will likely be further enhancements to data loss prevention controls within Google Workspace. Hopefully, future updates will also include official API controls for IMPORTRANGE and other functions to facilitate legitimate data access for developers while maintaining data security.

Additional Resources: