Skip to content
English
  • There are no suggestions because the search field is empty.

How to dynamically select the data source for your presentation

Connect a Google Drive folder containing multiple data sources and use a variable to select the data for each presentation

In some use cases, we need to dynamically select the data source. Take the example where we have a separate Google Sheet file for each client or sales prospect but we want to use the same slide 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 Google Sheet and pull in the data.

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

 

  1. Organize your data sheets

    Place your Sheets into a Google Drive folder. Each Google Sheet must have the same layout (i.e. headings and tables must be in the same cell location in each version) and worksheet names (i.e. Sheet1, Sheet2) so that you can index into the cells. For example, if Sheet 1 cell A5 has the client name in one sheet, it must also contain the client name in the other sheets.

  2. Connect to Slideform

    Add the Google Drive folder as a data source. Go to Data Sources > Add Data Source. Select Google Drive > Add Integration, and then either select the folder or 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, see How to create a slide deck template.

    Your template must include a pragma that will hold the data source name. This pragma will be used to select among the different Google Sheets in the folder. 
    In my example, this pragma {{sheet name}} is displayed on the slide, but if you do not want to display it, just put the pragma in the speaker notes on any slide.
  4. Set a pragma for the data source name

    The user must set the value of the data source name pragma before output can be generated. Let's take a look at my project's Configure Data screen, for the {{sheet 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 files in the folder and allow the user to select the correct one. Here's 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
  5. Configure the data mapping for the remaining pragmas

Now you need to preset a value for the other data in your presentation. Let's look at the example below.

Screenshot 2024-05-28 at 3.19.31 PM

For {{data:table1}} , we want to pull in Sheet1 cells A1:C4 from whichever Google Sheet file we are using. Remember that the name of the Google Sheet file is stored in the pragma {{sheet name}} .

To set this up, click Preset a Value and select the Google Drive folder as the data source. Then choose Query Data Source and <Lookup in Pragma> for the default sheet/table. Select the pragma that holds the data source name.

In the query box, enter your query using SQL syntax, such as select B5:B13 from Sheet2.You can select a range of cells and use Slim Table to crop it down to only the cells that contain data. Or you can select just a single cell to pull in a text or number value.

For charts, enter a query like select chartname from Sheet1. The chart name is the chart title from the Google Sheet.

Remember that the worksheet names, such as Sheet1, and the chart names must be consistent across all Google Sheets files in order to dynamically switch between Sheets files.

6. Generate the output

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

 

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