In this article:

Create PDFs from Typeform responses

May 8, 2024

Automatically generating PDFs from Typeform responses streamlines the process of generating documents such as invoices, reports, and letters.

This automation saves time, reduces manual entry errors, and ensures consistency across documents. It's particularly useful for businesses and individuals who frequently generate documents with similar structures but varying content.

For this solution Lido merges your Typeform responses into a template created in Google Docs and then saves a PDF version of it on your Google Drive.

Create a Google Doc template

First, we'll need to make the Google Doc template that will get populated with our Typeform responses. You can either start from scratch, or adapt an existing template that you have.

We'll designate which parts of the document will be replaced with Typeform data by using the {{Column Name}} syntax. (make sure there are no spaces between the curly braces and letters)

The key here is that whatever is inside of the curly brackets {{ }} must exactly match the name of the column name in your Typeform, including the same capitalization and spaces. So for example, if in our Typeform we have a column for First Name, then everywhere we want that value to be inserted into the template we'll need to put {{First Name}}.

The contents of your Google Doc template


Connect your Lido to Typeform

We will use Lido, a new spreadsheet built to automate repetitive tasks, to merge our Typeform responses into the Google Doc template to create new PDFs. There is a free tier with paid plans as well. You can create a new account here: https://www.lido.app/go/signup

Step 1. From the Lido Files page, click Create a new file

Step 2. then click Connect Data and select Typeform.

Follow the prompts to authenticate into Typeoform and allow Lido access to your Typeform responses.

Connect Lido to Typeform

Select all of the columns that you want to connect to Lido. Make sure to connect all of the columns that are referenced as variables in your Google Doc template.

Click Add Data.

Your Lido spreadsheet should now have connected data from your Typeform. It will look like this:

Add the CREATEPDF formula

Now we need to add the formula to create the PDFs with our Typeform data. The formula looks like this: 

    =CREATEPDF(<drive credential>,<template file>,<file name>,<status cell>)

Drive Credential - if its your first time, you'll need to add a credential to give Lido access to reading your Google Doc template and saving a PDF to your drive.

Template file - use the file picker for Google Drive and choose your Google Doc template file.

File Name - name of the new PDF that is being created. You can make dynamic file names such as:

     "Application Form for " & B2

Status Cell - when the PDF is generated successfully, the full path to the new PDF will be put in this cell. Usually, its the next column over from CREATEPDF.

      for example:  https://drive.google.com/file/d/19_gQmtwNCUPayLII4cxcRXxJKvpQW6fE/view

Step 1: Create a Computed Column in your Lido spreadsheet table.
  1. Hover your mouse over the green table of Typeform responses in Lido. You'll see a "+" sign.
  2. Choose "Add Computed Column".
  3. Name the Column "Create PDF?" (or whatever)
  4. Start Typing the =CREATEPDF() formula in the second row.

^^^

info

Computed Column

A Computed Column in Lido copies the same formula down to every row and grows as your data grows.

^^^

Step 2: Add a Google Drive Credential.

You can do so by choosing "Add Credential" in the first argument of CREATEPDF. Follow the prompts.

Step 3: Finish out the CREATEPDF formula

  1. Choose your Google Doc template
  2. Specify name of PDF that will be created. Include something dynamic such as "Grant Application for: " & B2 (where B2 holds the name of applicant for that row of data).
  3. Include the status cell (in this case, the next column over - F2 if you're in the 2nd row. .

Step 4. Create a new Linked Column called "Status"

Create a new Linked Column and name it "Status".

A Linked Column needs to tie itself to another column with unique values in your data (a "Unique ID column"). Timestamp, orderid, or email are often good columns to use as an ID Column.

Create a Linked column for Status

^^^

info

Linked Column

A Linked Column in Lido lets you add notes to external data - and stays linked to your source data (such as records in Google Sheets) by tying itself to a column in the source data that has unique values. Timestamp, ID columns, or email can be good "ID Columns" for a Linked Column.

^^^

^^^

info

Create a Google Doc

If you want to create a Google Doc instead of (or in addition to) a PDF, you can use the =CREATEGOOGLEDOC() formula in place of =CREATEPDF(). It takes in the same formula inputs.

^^^

Note: After you create the Status column, you'll need to reset the 4th argument of CREATEPDF to make sure its the correct column (it'll get pushed over one column).

Run a Test

Run a test of any of THE CREATEPDF action formulas and review the generated PDF.

  1. In the same cell as the CREATEPDF choose "Run Action" from the cell action menu.

Run the Column

To run the whole column of actions, choose "Run Column Now" from the "Create PDF" column menu. This will run all CREATEPDF cells in the column

You can run this column manually to generate your new PDFS. However, if you'd like to automate this whole process to automatically create a PDF whenever a new row Typeform Response is submitted, then read on.

Automatically Create PDFs

To automatically create a PDF when a new Typeform response is submitted,  we'll create an automation on the "Create PDF?" column where the CREATEPDF action formula is.

Step 1. Make sure to only create a PDF if one hasn't already been created.

We only want to create a PDF if we haven't already created one for that Typeform response. In other words, only if the Status column (column F) is blank.

We do this by using a regular spreadsheet IF formula, and only show CREATEPDF if our criteria is met. In this case, by making sure the Status field is still blank. If a new Typeform response is submitted, this will evaluate to TRUE.  Otherwise, it will show FALSE.

     =IF(F2 ="",CREATEPDF(<credential>,<path to template>,<file name>,<status>))

Example of only showing CREATEPDF if the Status column is empty

Step 2. Automate the "Create PDF?" column

Choose "Run Column on a Schedule" from the column menu for the "Create PDF?" column. Choose the interval that makes sense, daily, hourly, etc.

At the time you specify Lido will fetch the latest responses from Typeform, evaluate the Lido spreadsheet, and any action formulas will be run (CREATEPDF is an action formula)

Run the Create PDF? column on a schedule by creating an automation

Review

Let's review what we covered!

  1. Lido connects "live" to Typeform (new records are pulled in automatically)
  2. Lido uses an action formula, CREATEPDF, to generate a new PDF for each Typeform response based on a Google Doc template.
  3. You can set up an automation to regularly check for new Typeform responses and automatically create a PDF for each one.

Frequently asked questions

Can I choose a different template depending on the values in my Typeform?

Yes! A template is just the URL to your actual Google Doc template file. So you can set up a spreadsheet formula in Lido to check some other value and change the template accordingly. You can use this formula directly inside of CREATEPDF, or in its own column and refer to it in CREATEPDF.

     =IF(B2="Professional Package","<path template #1>,<path to template #2>)

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->