Export to Google Slides from AppSheet

Building presentations can be a time consuming process. There are many cases where the slides we need are simply replicas of existing slides with updated data. This is an example of how to generate a Google Slides presentation using data from an AppSheet app based on a slide template.

Here we have a sales automation app for tracking customer leads assigned to sales reps. Let's say the sales rep has two needs (1) "I need to generate a 'custom' pitch for each of my customer" and (2) "I need to report progress on all of my accounts." We can accomplish both from an AppSheet app.

Export Example #1: "Export Deck" action

export_deck.gif

Export Example #2: "Export Repeated Slide" action

export_repeat_slides.gif

If you would like to export some data from your AppSheet app to Google Slides, you can follow the instructions below:

Instructions to Replicate:

Step 1: Copy the Apps Script file located here

alafontant_0-1695723451075.png

Step 2: Add the Apps Script automation to your app. You will need to authorize the project after you select the file.

alafontant_1-1695723451835.png

Step 3: Select the right function from dropdown list. Select the exportSlides function to paste specific values of data into a presentation. Select the exportRepeatSlide if you need to duplicate a single slide multiple times with data from a list in AppSheet.

alafontant_1-1695742124763.png

 

exportSlides
templateUrl The link to your template presentation. For example:
"https://docs.google.com/presentation/d/1M_UTNlBZHE9y_v7FqLtPaCwGInOl9gBYdNemrMjJy2c/edit"
deckTitle The new name for the presentation after the export. For example:
"Customer Presentation: " & [customer]
userEmails The recipients email addresses. You can have multiple as long as they are comma-separated.
"user1@test.com", "user2@test.com"
content The data that should be included in the export. The list is structured in pairs. The first item is the key label that is included in your presentation template. The second item is the data that you want to paste into the presentation. The script functions by finding the key and replacing it with the item directly following it in the list.

Note that image urls are supported, but not file paths to Google Drive. The key name for an image must have "image" somewhere in the key name to be recognized by the script (e.g., "Company Image" or "Profile-image"). The key name does NOT get written into the template directly, rather you add the key to the "Alt Text" of an image placeholder.

For example:

LIST(

TEXT("Company Name"),
     TEXT(LOOKUP([reference_id], "customers", "customer_id", "company_name")),

TEXT("Full Name"),
      TEXT(LOOKUP([reference_id], "customers", "customer_id", "full_name")),

TEXT("Company Image"),
       TEXT(LOOKUP([reference_id], "customers", "customer_id", "image"))

)

 

exportRepeatSlide
templateUrl The link to your template sheet. For example:
"https://docs.google.com/presentation/d/1RcmHrWKr4SDbriDLO-fxaAendk94D_5vkaDnEbHXoXs/edit"
deckTitle The new name for the presentation after the export. For example:
"Leads Report: " & [region]
slideNumber The slide number of the slide that needs to be duplicated. If there is only one slide then it's 1, if there are multiple, you can identify the slide number on the slide preview pane on the left-hand side of Google Slides.
userEmails The recipients email addresses. You can have multiple as long as they are comma-separated.
"user1@test.com", "user2@test.com"
content This field represents the data that should be included in the export. Similar to other functions, it is structured in pairs, but each item in the pair is a list itself. The first item is the key label that is included in your presentation template. The second item is the column of data that you need to include on each slide. The script works by creating a new slide for each item in the list.

Note that image urls are supported, but not file paths to Google Drive. The key name for an image must have "image" somewhere in the key name to be recognized by the script (e.g., "Company Image" or "Profile-image"). The image must also be contained within a table in the document template to ensure appropriate sizing.

For example:

LIST(

LIST(TEXT("Company Name")),
     SELECT(customers[company_name], [reference_id] = [region].[rep_id]),

LIST(TEXT("Full Name")),
      SELECT(customers[full_name], [reference_id] = [region].[rep_id]),

LIST(TEXT("Company Image")),
      SELECT(customers[image], [reference_id] = [region].[rep_id])

)

Step 4: Create your Google Slides template. You template will vary depending on the function you need.

exportSlides: Your presentation template needs to include the "keys" in every location where you want to include the data. The key should be between brackets, e.g., {Customer Name}

exportRepeatSlides: Your slide template needs to include the "keys" in every location where you want to include the data. The key should be between brackets, e.g., {Customer Name}. The slide to duplicate can be within an existing deck (e.g., as appendix slides) as long as you specify the slide number in the function above.

Note that for either case, you must take special steps to support images. This requires two steps (1) Create an image placeholder and (2) Change the Alt Text for the placeholder to include the key name. Keep in mind that the key name still needs to include "image" e.g., Customer Image. Note that the key for images should not include brackets

Step 1: Create the image placeholder Step 2: Add the key to the Alt Text
alafontant_2-1695743569434.png alafontant_3-1695743647224.png

Please note, this is merely one example of how to use Apps Script to export to Google Slides and alternative implementations are certainly possible.

Quick Links
Example App (remember to authorize the apps script project in the automation tab if you copy this template)
Apps Script File
Slides Presentation Template
Slides Single-Slide Template

5 3 1,064
3 REPLIES 3

Well done
Too bad the access is no longer good.

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Which file are you trying to access?

on the app. the other links work fine

Top Labels in this Space