Document and Media Management Generating Documents from JotForm Submissions

Automating document creation saves time and eliminates manual data entry. This guide shows you how to automatically generate PDF documents whenever a JotForm is submitted, search your Google Drive for existing versions of that document, and intelligently decide whether to upload a new file or replace an existing one.

By setting up this workflow, you ensure your team always has access to the most up-to-date documents without cluttering your storage with duplicates.

Workflow overview

This automation relies on branching logic to determine how to handle the generated document. Here is how the process flows:

flowchart TD
    A[New JotForm Submission] --> B[Generate Document PDF]
    B --> C[Search Google Drive]
    C --> D{Does the file exist?}
    D -- Yes (Previous PDF Found) --> E[Replace Existing File]
    D -- No (First Time PDF) --> F[Upload New File]

Configuring the automation

Follow these steps to set up your document generation and routing logic.

  1. 1

    Capture the JotForm submission

    Start your workflow with a JotForm trigger. Whenever a user submits your specified form, the automation will capture the form data to use in the subsequent steps.

  2. 2

    Search for existing files in Google Drive

    Before saving a new file, check if a previous version already exists. Configure a Search action in Google Drive using the expected title of the document.

    Ensure you set the search to look for specific file types (like PDFs) within a designated folder to avoid accidental matches.

  3. 3

    Set up branching logic (Paths)

    Create a branching step to handle the two possible outcomes of your search:

    • Path A (Previous PDF Found): Set the filter criteria to continue if the search step successfully found a file (Search was found status = true).

    • Path B (First Time PDF): Set the filter criteria to continue if the search step did not find a file (Search was found status = false).

  4. 4

    Configure file actions for each path

    Finally, tell the automation what to do in each scenario:

    • In Path A: Add a Replace File action. Use the File ID from your search step to overwrite the old document with the newly generated PDF.

    • In Path B: Add an Upload File action. Save the newly generated PDF directly to your designated folder.

For the branching logic to work correctly, ensure your search step is configured to Continue on failure (or "Success on Miss"). If the search step halts the workflow when a file isn't found, Path B will never execute.

When configuring the Google Drive search step, use these recommended settings to ensure accurate file matching:

ParameterRecommended SettingDescription
Search TypeFilename containsAllows partial matching of the generated document title, which is helpful if dates or IDs are appended.
FolderSpecific Folder (e.g., All MLS Data Sheets)Limits the search to a specific directory to prevent accidental overwrites of unrelated files.
File Typesapplication/pdfEnsures the automation only evaluates PDF documents, ignoring Docs, Sheets, or images with similar names.

Be careful when using "Filename contains" if your document titles are very generic (e.g., "Invoice"). Use unique identifiers like a submission ID or client name in the filename to prevent overwriting the wrong document.

Frequently asked questions

Why is my automation creating duplicates instead of replacing?

This usually happens if the search step fails to find the existing file. Double-check that your search parameters (Folder, File Type, and Filename) exactly match the existing files in Google Drive. Also, verify that your branching filter for Path A is correctly checking for a "true" found status.

Can I generate formats other than PDF?

Yes. While this guide uses PDFs as an example, you can generate and route other file types. Just remember to update the File Types parameter in your Google Drive search step to match your new format (e.g., application/vnd.google-apps.document for Google Docs).

Can I update other systems, like Monday.com, in this workflow?

Absolutely. You can add additional actions to either branch. For example, after replacing the file in Path A, you can add a step to update a column value in a Monday.com board with the latest submission data.

Next steps

Ready to expand your document workflows? Check out these related resources:

Google Drive Integration Basics

Learn more about managing folders, permissions, and file conversions with our Google Drive tools.