How to automatically generate contracts, handover reports and quotes from data

Still copying the client's name, address and amount into a contract or quote by hand? Here's how to generate documents straight from record data, using a template with placeholders.

Marek Raja

A contract, handover report or quote almost always has the same structure - only the specific details change: client name, address, line items, amount, date. Yet in most companies this data still gets copied by hand from the database into the document, every single time. It can work the other way round: the document is generated from the data, not the other way around.

A template with placeholders as the foundation

The principle is simple. Instead of fixed text, you put placeholders into a document template - say {{name}}, {{address}} or {{total_amount}}. The moment the template is used on a specific record, the placeholders get replaced with the actual values from that record. So one template can generate any number of different documents, always with the correct, current data.

How the placeholders fill themselves in

Filling in the placeholders isn't a manual step - it happens automatically the moment the document is generated from the record. If an automation is also involved in the process, you can add another step before generation, such as inserting an image, a payment QR code, or merging several source documents into one resulting PDF.

An automation adds an image to it and generates one PDF.

The template fills in with data from the record, an automation adds an image or attachment to it, and both are merged into one generated document.

Typical use cases

  • Invoice - line items and amount from the order, a payment QR code, no manual retyping.
  • Handover report - order and client details, space for a signature.
  • Quote - options, prices and terms filled in based on the specific opportunity.
  • Contract - parties, subject and amount filled in from the client and order records.

The same principle works for document sets too - an invoice, report and contract generated all at once from a single record, each from its own template.

Where the document stays after it's generated

A generated document shouldn't end up as a lone file in an email - it makes sense for it to stay attached back to the record it came from. That way, you can see at any time, right on the order or client, which documents have already been generated and when.

The opposite direction - where a document isn't produced but an incoming email is read and turned into a record - is described in AI reads the email and creates the job.

Frequently asked questions about generating documents from data

Do I need to create a new template for every document type?

Yes, each document type (invoice, report, quote) usually has its own template with placeholders, but a single template can be reused for any number of records.

Can a template include an image or QR code, not just text?

Yes, a template can combine text filled in from placeholders with images, payment QR codes, or database views that get inserted into the document automatically.

Can I generate several documents at once as one set?

Yes, several templates (say an invoice, a report and a contract) can be generated from a single record at once and merged into one print set ready to download.

Describe the documents you want to generate.

No developer needed - control it with AI too