How to dynamically select images from Google Drive

Connect a Google Drive folder containing multiple images and use a variable to embed an image in your presentation

In some cases, we need to dynamically select images to be used in a presentation. Take the example where we have a separate logo for each client or sales prospect but we want to use the same slide deck template for all clients. In that case, the first placeholder we need to fill in is the name of the client. Then we can select the correct logo image for the presentation.

This scenario is really simple with Slideform! Read on for the play-by-play instructions, or watch the tutorial here:

  1. Organize your images.

    Save your images in a Google Drive folder. Make sure they have descriptive file names.

  2. Connect to Slideform.

    Share the Google Drive with share@slideform.co . Add it as a data source by going to Data Sources > Add Data Source. Select Google Drive > Add Integration, and then paste in the URL of your Drive folder (use the URL from the browser, not the share link). Click Save and wait a few minutes for the data to be indexed.
  3. Create a presentation template

    Make a slide deck with placeholders and save it in Slideform. For details, go to How to create a slide deck template

    Your template must include a pragma that will hold the image file name. This pragma will be used to select among the different images in the folder.  If you do not want to display this filename on the slide, just put the pragma in the speaker notes on any slide.
    The template must also have a pragma for the image. In this case it should be a chart pragma with syntax {{chart: company logo}} and it must be inside a shape element on the slide.
  4. Set the image file name

    The user must set the value of the file name pragma before output can be generated. Let's take a look at my project's Configure Data screen, for the {{file_name}}   pragma.
    The best way to set a value for this pragma is to set up a dropdown menu for the user to select from. We will pull in the list of images in the folder and allow the user to select the correct one. Here is how it is set up:Screenshot 2024-05-28 at 3.14.59 PM
    1. How should the user enter their answer? -->  Select from Dropdown
    2. Click Preset a Value
    3. Where is the data from? --> select the Google Drive data source
    4. Select how to obtain the metrics --> Use Predefined Metric
    5. Select your worksheet --> leave blank
    6. Select your KPI --> List of Documents
    7. Make sure to select "No Function" under the Apply a function dropdown.
  5. Configure the data mapping for chart pragma. 

Now you need to preset a value for the image itself. Let's look at the example below.

Screenshot 2024-07-01 at 10.43.14 AM

For {{chart: company logo}} , we want to pull in the image named in the {{file_name}} pragma.

To set this up, click Preset a Value and select the Google Drive folder as the data source. Then under select your charts, choose the correct pragma that holds the image name.

6. Generate the output

Click Generate on the project card. The first thing you will do is select the image file name from the dropdown menu that you created. Then the image will be filled in and the output can be saved.

 

We're here to help!  Contact support@slideform.co if you have any questions.