Skip to content

The moment it happens

Create a contract PDF from each form entry

Each form submission becomes a filled-in contract from your template, saved as a PDF in Drive.

Runs
The moment it happens
Apps
Google Drive
AI
Not needed
Access
read+write (drive, plus documents scope for the text replacement)

Send this to your assistant

Create a ClickRuntime automation: give me a link my form can send to. Copy my Contract template doc, replace {{name}}, {{date}} and {{amount}}, save it as a PDF in Contracts and email me the link.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A small consultancy sends a service agreement to every new customer. The process is: copy the Google Docs template, find each placeholder, type the customer's company name, address, start date and monthly fee, check it twice because a wrong fee in a contract is expensive, export a PDF and attach it to an email. On a busy day it takes ten minutes per contract, and the customer is waiting for it.

The moment someone submits your form, ClickRuntime copies your template, replaces every placeholder such as the company name, address and fee with the submitted values, and exports the result as a PDF into Drive. It then emails the link, so the customer or your team receives a finished contract without anyone opening the document.

The same approach covers quotes, offer letters, NDAs, certificates, rental agreements and permission slips.

What you get out of it

  • Contracts go out while interest is high

    A customer who signs up in the morning gets a document within moments, not after lunch. Quick turnaround closes more deals because there is less time for second thoughts or another vendor's quote.

  • Values come from the form, not memory

    A fee or date typed once by the customer is the one that appears in the contract. That removes the transcription mistakes that lead to disputes, credit notes and awkward corrections after the paper is signed.

  • One approved template stays in force

    Legal wording lives in a single Docs template. When you improve a clause, every future contract uses the new text, and nobody is accidentally sending a version from last year saved on a desktop.

  • A PDF copy filed automatically

    Each generated PDF is stored in Drive next to the other client files, so finding what was actually sent is a search away. That helps when a customer later says they never received those terms.

  • Staff time for the actual conversation

    Ten minutes of find-and-replace per document adds up to hours every week. Removing it lets the person who used to prepare paperwork spend that time on calls with the customers instead.

How it works

What happens, step by step

  1. When someone submits your form, ClickRuntime receives their answers straight away.

  2. It makes a copy of your contract template in Google Docs and fills in the blanks with the form answers.

  3. The finished contract is saved as a PDF in your Contracts folder in Google Drive.

  4. You get an email with a link to the PDF.

Before it runs live

  • Connect Google Drive
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Create a contract PDF from each form entryjust nowSucceeded
Email · Contract ready: Northwind Ltdhttps://drive.google.com/file/d/1aBcD2eFgH3iJkL/view

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Drive steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
fill_a_document_template_from_a_form.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_event, credentials, notify

TEMPLATE_ID, CONTRACTS = "contract-template-doc-id", "contracts-folder-id"

@on_event
def handle(event):
    form = event.json or {}
    creds = Credentials(credentials.connection("google", "work"))
    drive = build("drive", "v3", credentials=creds, cache_discovery=False)
    docs = build("docs", "v1", credentials=creds, cache_discovery=False)
    copy = drive.files().copy(fileId=TEMPLATE_ID, body={"name": f"Contract – {form['name']}"}).execute()
    docs.documents().batchUpdate(documentId=copy["id"], body={"requests": [
        {"replaceAllText": {"containsText": {"text": "{{" + key + "}}", "matchCase": True}, "replaceText": str(form[key])}}
        for key in ("name", "date", "amount")]}).execute()
    pdf = drive.files().export(fileId=copy["id"], mimeType="application/pdf").execute()
    saved = drive.files().create(body={"name": f"Contract – {form['name']}.pdf", "parents": [CONTRACTS]},
                                 media_body=MediaInMemoryUpload(pdf, "application/pdf"), fields="id,webViewLink").execute()
    drive.files().delete(fileId=copy["id"]).execute()
    notify.email_me(f"Contract ready: {form['name']}", saved["webViewLink"])
    return {"pdf": saved["id"]}

FAQ

Common questions

How are placeholders written in the template?
Use a clear marker such as {{company_name}} or {{start_date}} in the Google Doc, and match each one to a form question. Any placeholder with no matching answer is flagged so you do not send a contract with a stray bracket in the middle of it.
Can the same document be filled with more than one form?
Yes. You can point several forms at different templates, or one form at one template, and each submission creates its own copy with its own PDF. The template itself is never edited, only the copies made from it.
Does the customer sign it electronically?
The output is a finished PDF, not a signed one. You can send it to an e-signature tool afterward, or have the customer print and return it. The generated file is a good source document for whichever signature process you already use.
What permissions does it need?
read+write (drive, plus documents scope for the text replacement). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Create a contract PDF from each form entry” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.