Automatically create Google Slides from Google Form Response

Updated on March 18,2023

Do you want to automatically create Google slides from a Google Form response?

A typical application is when you want to automatically create a certificate for everyone who completes a survey or embed Google Forms summary charts.  

This guide will teach you how to achieve the task step-by-step.

We will use an example of a Cockroach Cafe restaurant testimonials.

Our made-up restaurant wants to create slide testimonials from customers' responses on a Google Form.

The guide is divided into four sections:

  • Creating the Cockroach Cafe Testimonials Google Slide Document
  • Adding a template Slide to the document
  • Create Cockroach Cafe Testimonial Form
  • Adding AppScript for automation

Creating the Cockroach Cafe Testimonials Google Slide Document

The first thing we need to do is to create a Google slide document to be updated automatically in the following stages.

New Google Slide Document

Adding a template Slide to the document

The next step is to create a template to be used to create the slides.

In our example of cockroach testimonial, I have created a simple template with two variables, {{testimonial)) and {{name}}.

Update your template to fit your needs.

Use curly braces or any other unique character/wording uniquely identifying each variable. 

We will replace these variables with data from the form using AppScript.

Slide Template

 

Create Cockroach Cafe Testimonial Form

Halfway done, the next step is to create a google form.

Google Form

Are you interested in saving the form in a Google spreadsheet? 

Click on the responses tab, then click Link to Sheet. Choose an existing google sheet document or create a new copy in the popup modal.

That's it. A copy of all the responses will be saved in the google sheet.

Adding AppScript for automation

The final step is to add Apps Script code to facilitate the automatic creation of the slide.

Apps Script is a rapid application development platform that makes creating business applications that integrate with Google Workspace easy.

Click the three-dotted icon at the top of the menu, then select Script Editor.

Script Editor

Replace your code with the code below:


function updateSlideOnSubmit(e) {
  var formResponse = e.response;
  var itemResponses = formResponse.getItemResponses();
  var name = itemResponses[0].getResponse();
  var testimonial = itemResponses[1].getResponse();
  var testimonialVariable = '{{testimonial}}';
  var nameVariable = '{{name}}';
  var PRESENTATION_ID = "";
  // Open the presentation
  var presentation = SlidesApp.openById(PRESENTATION_ID);
  var sourceSlide = presentation.getSlides()[0]; // replace 0 with the index of the slide you want to copy
  var destinationSlide = sourceSlide.duplicate(); // create a copy of the source slide
  destinationSlide.replaceAllText(nameVariable, name);
  destinationSlide.replaceAllText(testimonialVariable, testimonial);
}

Note: Replace <YOUR_PRESENTATION_ID> with the presentation id of your slide. You can obtain the presentation id from the URL of your presentation. The URL is in the format https://docs.google.com/presentation/d/<YOUR_PRESENTATION_ID>/edit

Finally, create a trigger for your Apps Script function.

From the Script Editor window, click "Triggers" from the side menu, then select "Add Trigger" in the next window.

Update your form as shown in the image below and click on save.

Trigger

You'll be redirected to your google account to allow the script to update and edit your slide.

Once you are done, then you are good to go. A new testimonial slide should be automatically created anytime the form is filled.

Testing our Automation

Let's leave a review as a customer and see if a slide is automatically created.

Here we go; the slide was automatically created!

Slide created automatically

Ready to automate your Google Workspace workflow? Let me help you save time and work smarter! Book a call with me today for expert assistance with creating similar automation manually or using popular automation tools like Zapier and Make.



More in this category: How to automatically Sync your Google Sheet with Monday.com ยป