Automate workflows for Google Workspace

[ad_1]


Posted by Mike Procopio, Senior Employees Software program Engineer

This week, we launched the Apps Script connector for AppSheet, which now makes it potential to name Apps Script code features from a no-code AppSheet app. This significantly extends the talents of AppSheet apps by letting them entry the facility that Apps Script offers. For instance, an AppSheet app can now use Apps Script to automate workflows with Google Workspace utilizing the Workspace APIs for Drive, Docs, Sheets, and Admin SDK, and extra – in addition to different Google companies like YouTube, Google Analytics, and BigQuery.

Google AppSheet

AppSheet is Google’s platform for constructing no-code customized apps and workflows to automate enterprise processes. It lets app creators construct and deploy end-to-end apps and automations with out writing code.

Enhancing an App Definition in Google Appsheet

Overview of No-Code

Earlier than we dive into the Apps Script connector function, let’s check out what we imply by no-code. No-code platforms like AppSheet allow citizen builders to shortly construct apps robotically via knowledge evaluation utilizing web-based person interfaces. These are usually constructed on prime of an information supply like Google Sheets, MySQL, Salesforce, or different database. Creating these apps doesn’t require a standard software program engineering background; enterprise technologists and analysts with a variety of ability units can construct apps that make their work simpler and extra environment friendly.

In a no-code platform like AppSheet, an app creator makes use of a web-based editor UI to outline how the app ought to behave, as a substitute of writing particular code to realize that. They’ll specify issues like what the app ought to do, what knowledge supply it is constructed on, what the information means, what UI the person sees, what occasions to pay attention for and what actions to take after they happen, and so forth. The app is then deployed in manufacturing as an end-to-end, data-driven app with a UI, all with out “writing” any precise code. That is all clear to the top person, who merely sees an ordinary internet or native app.

Why No-Code Works Properly

In observe, no-code platforms work very properly for a big class of apps. Why? As a result of many apps are functionally very related – specifically those who implement inside enterprise processes. These apps share many widespread traits: A knowledge supply for storing knowledge, an idea of an information “report,” UIs and types to gather and edit knowledge, user-specific views of that knowledge, expressions to outline transformations of information, actions to take when knowledge is modified, admin controls to handle permissions, and so forth.

For instance, think about an app for creating and approving an worker journey request. This app shares many widespread traits with an app for, say, creating and approving expense experiences. In each apps, an worker creates a report which will get reviewed and annotated, customers are notified when modifications are made, and ultimately the request is accomplished and closed out. Equally, an inside app for monitoring workers’ assigned pc tools has quite a bit in widespread with any generic stock monitoring, success, and ordering system.

A no-code platform’s problem is at all times balancing expressiveness with high-level abstraction. Luckily, enterprise processes have a tendency to adapt to a well-understood core set of expectations round knowledge, knowledge lifecycle, and course of. This is the reason no-code platforms carry out properly on this house. Nevertheless, there could also be instances when the necessities of the app transcend what a no-code platform can present. The brand new Apps Script connector significantly improves the expressiveness (capabilities) of a no-code app – guaranteeing that the app can develop to accommodate altering necessities or enterprise processes as they evolve.

Google Workspace, Workspace APIs, and Apps Script

Google Workspace is Google’s cloud-based productiveness suite, enabling groups of all sizes to attach, create, and collaborate. You could be conversant in many of those apps, like Gmail, Calendar, Drive, Docs, Sheets, Slides, and others. Every of those apps additionally comes with a strong developer API that lets app builders programmatically combine with it. For instance, the Drive API permits its customers to add and obtain information with code, the Gmail API lets apps combine with its messaging features, and the Google Docs API permits script-based enhancing of Google Docs.

Utilizing Google Workspace integrating Chat, Gmail, and doc previews

Apps Script is a low-code platform that makes it fast and straightforward to construct enterprise options that combine, automate, and lengthen Google Workspace. It does this by offering easy-to-use high-level “wrappers” round APIs, enabling customized integrations with Google Workspace and exterior companies. Apps Script additionally integrates with Google companies reminiscent of YouTube, Google Analytics, and BigQuery. It’s a highly effective platform, enabling script authors to implement advanced enterprise logic and macros and name exterior companies, for instance a third-party vendor’s knowledge change system or a machine studying classification service.

Enhancing a script within the Google Apps Script code editor

Introducing the Apps Script connector for AppSheet

The Apps Script connector for AppSheet, launched this week, ties every thing collectively: AppSheet, Apps Script, Google Workspace, and Google Workspace’s many developer APIs. This integration lets no-code app builders utilizing AppSheet significantly lengthen the capabilities of their no-code apps by permitting them to name and cross knowledge to Apps Script features. A technique to consider this integration is that it bridges no-code (AppSheet) with low-code (Apps Script). Importantly, the one who writes the Apps Script script doesn’t must be the identical because the no-code AppSheet app creator that calls the script (and infrequently gained’t be).

From the Apps Script developer perspective, this opens the door to some vital capabilities. One among AppSheet’s largest advantages is that it means that you can simply deploy an precise end-to-end app with a UI (frontend). With the brand new skill to name your current Apps Script code, creating or changing any current front-end with a no-code AppSheet app turns into a probably game-changing possibility.

Utilizing the Apps Script connector for AppSheet

In AppSheet, configuring that is simple and requires no code aside from the script itself. The core thought is that the app creator chooses the Apps Script script to name by configuring an AppSheet “Process,” which is an motion taken when an AppSheet Automation is triggered.

Such an motion usually happens within the context of a selected knowledge row in AppSheet’s knowledge supply; for instance, an automation might be triggered when a brand new knowledge report is created by one of many app’s finish customers. Lastly, the app creator can specify values to cross in to the parameters of the Apps Script operate primarily based on values within the energetic knowledge report.

Enhancing an Automation Process in Google AppSheet

Right here’s how you can set this up in 5 simple steps:

  1. In AppSheet, choose the Automation display, create a brand new Bot with an related Occasion to pay attention for, and at last and select the Name a script possibility for the Process:

    Configuring an AppSheet Automation Process to name an Apps Script operate

  2. Then, below “Apps Script Undertaking,” select the script to name. This code might be created utilizing the Apps Script editor, and might be in App Creator’s Google Drive (it may be shared with them by another person):

    Selecting the Apps Script Undertaking to name from Google Drive

  3. As soon as chosen, a listing of the out there features within the Apps Script mission might be proven within the Perform title dropdown. Right here, select the operate to name from AppSheet.
  4. After the operate to name is chosen, a listing of its parameters — further knowledge handed in when calling the operate – is then proven.

    Displaying the parameters to cross to the logTravelRequestUpdate() Apps Script operate

  5. For every operate parameter, use the AppSheet Expression Assistant to specify what worth to cross for the parameter when the automation is known as. An expression generally is a easy column within the AppSheet app’s knowledge supply, or a extra advanced operate or computation involving a number of columns.
  6. Utilizing the AppSheet Expression Assistant to decide on which values to cross to the Apps Script operate parameters

Lastly, save the Process within the AppSheet Editor utilizing the Save button.

And that’s it! When the automation is triggered (for instance, when a person provides a brand new knowledge row), the AppSheet automation engine will name the desired Apps Script operate, passing within the values from the evaluated expressions as operate arguments. Particulars concerning the operate name might be out there within the AppSheet Automation Monitor.

Instance Code

Right here’s a easy instance you may strive by yourself primarily based on a Journey Request Device AppSheet app proven within the above screenshots. (Extra examples are additionally given within the Pattern Scripts part under.) The code under is an Apps Script operate that provides particulars about an worker journey request to a Google Docs doc simulating an “audit log”. It makes use of the Google Docs API through the DocumentApp wrapper library out there in Apps Script.


 TravelRequestAuditLogger.gs 

operate logTravelRequestUpdate(RequestDate, Requestor, Origin, ...) {
  var TRAVEL_REQUEST_AUDIT_LOG_DOCID = 'your_docid_here'
  var doc = DocumentApp.openById(TRAVEL_REQUEST_AUDIT_LOG_DOCID)
  var physique = doc.getBody();

  var dataParagraph = physique.insertParagraph(0, '');
  var headerText = dataParagraph.appendText('*** NEW AUDIT LOG ENTRY ***n');
  headerText.setBold(true);

  // Add within the audit log entry metadata.
  dataParagraph.appendText('New Journey Request Device audit log entry...n');

  dataParagraph.appendText('RequestDate: ' + RequestDate + 'n');
  dataParagraph.appendText('Requestor: ' + Requestor + 'n');
  dataParagraph.appendText('Origin: ' + Origin + 'n');

  // ... further values right here to append to Google Doc
}

When this operate is known as, for instance from an AppSheet automation when a brand new journey request is created, textual content might be added to the Google Docs doc primarily based on values handed in from AppSheet. The doc will look much like under when it’s up to date:

Instance Google Docs doc output, created from utilizing the Google Docs API in Apps Script with values handed in from AppSheet

Getting Began

We’ve created a listing of sources that will help you shortly get began and get neighborhood help.

Pattern Scripts

Listed below are three pattern scripts we’ve created that will help you get began.

Pattern Google Workspace Undertaking – Create a Doc, Sheet, Slide or ship an E-mail.

Create a Calendar Occasion – Create a customizable Calendar occasion.

Ship an interactive Chat message – Ship a message in Google Chat that opens a hyperlink or shows a picture.

We’re very enthusiastic about this announcement and we are able to’t wait to see what you construct for Google Workspace! To remain within the loop on bulletins about AppSheet and the Google Workspace Platform, please subscribe to our developer e-newsletter.

[ad_2]

Leave a Reply