Document templates from Zoho CRM with Zoho Writer, set up to run automatically

November 2, 2026

A practical guide to Zoho Writer merge templates for Zoho CRM: mapping fields and subforms, generating documents from a workflow, and storing the result on the record.

Abstract layered sheets flowing from a grid of small fields into one stacked, finished document shape

Document templates from Zoho CRM with Zoho Writer: how they work

To produce document templates from Zoho CRM with Zoho Writer, you build a merge template in Writer, map its merge fields to CRM fields, and let a workflow generate the document when a record meets a condition. The finished file can then be stored back on the CRM record. You do not copy and paste anything by hand.

A merge template is a Zoho Writer document with merge fields: placeholders that Writer fills with values from a data source, here a Zoho CRM record. One template serves every record. A letter, a proposal or a label sheet is the same layout each time, with different names, figures and addresses dropped in.

Zoho describes the setup in four steps on its Writer document automation page:

  1. Create a document template.
  2. Connect the document to your existing workflow.
  3. Map the merge fields to fields in the data source.
  4. Generate documents when a trigger event runs.

This guide follows those steps in order for Zoho CRM. It then covers the post-merge operations that file the document on the record, and the field-mapping mistakes that break templates after go-live. If you are new to Writer itself, our overview of Zoho Writer for UK teams covers the editor before you start on templates.

Building a Writer merge template and mapping Zoho CRM fields

A Writer merge template can draw on CRM data from the Leads, Accounts, Contacts and Potentials modules. Zoho's help article on workflow rules for mail merge lists these four. Potentials is the older internal name for Deals. You can create the template in Writer, or you can create it inside Zoho CRM.

In CRM, existing merge templates live under Setup > Customization > Templates > Mail Merge. You open, edit and rename them from there. A clear naming habit pays off later: put the module and the purpose in the name, for example "Deals - Proposal PDF". A workflow that calls a template is much easier to trace when the name says what it is for.

Starting from an existing Word or PDF file

A PDF can serve as a merge template. You can create it in Writer and add Zoho CRM as the data source. Alternatively, you can import it as a merge template in Zoho CRM. Word files need more care.

One user on the Zoho community forum imported a mail merge template directly from a .docx file. They reported that "the formatting went all over the place". The workaround was to open the file in Writer and fix the layout there first.

Plan time for clean-up on any imported letterhead. Do that work before you insert a single merge field. If you insert fields into a broken layout, you will end up fixing both at once.

Subforms and rich text fields in a Zoho Writer merge template

Subforms and rich text fields need specific handling in a merge template, because neither is a simple single value. A subform is a table of repeating rows inside one CRM record, such as the line items on a deal. A rich text field holds formatted content: bold text, lists and links.

Zoho's documentation says Writer mail merge supports rich text fields from Zoho CRM. Writer retrieves the full formatted content and keeps the original formatting in the merged document. Scope notes or terms written in a rich text field therefore keep their formatting in the proposal. You do not need to format them again in the template.

Subforms matter in two directions. To merge subform rows into the document, you place the subform fields in the template. To write data back, the same rule holds: Zoho's article on post-merge operations in Zoho CRM states that "to update the CRM record with the subform data, you need to add subform fields in the merge template." If the fields are missing from the template, there is nothing for the update to carry back.

Conditional content is the other common need. A community thread asks how to show only one CRM section when a specific checkbox is ticked, using If conditions. The poster said they needed guidance to compile the template correctly. Treat conditions as a build task to test record by record, not a quick edit.

Editing a CRM merge template safely: the temporary document and Update Template

When a user starts a merge from a CRM record, Writer does not open the template itself. It generates a temporary document from the chosen template and merges the record's data into that copy. Zoho's article on how mail merge templates work in Zoho CRM explains the behaviour.

The temporary document is for one-time use. It becomes invalid if you reload it, or reopen it after closing it. Zoho calls this "the expected behavior". Users who expect to come back to a half-finished letter later are often caught out by it.

Edits made in the temporary document do not reach the original template on their own. To save them into the template, the user must click Update Template. This is where uncontrolled changes creep in. A salesperson fixes a typo for one client, clicks Update Template, and every future document carries their wording.

The same temporary-document behaviour applies to the Zoho People and Zoho Recruit integrations. Zoho therefore treats it as a design rule, not a CRM quirk.

A sensible rule for a small team is short. Only the template owner clicks Update Template. Everyone else edits the copy, sends it, and reports any wording problem to the owner. Our guide on customising your CRM covers how to set roles so that only the right people change shared setup.

Three ways to generate Writer documents from Zoho CRM automatically

You can trigger Writer documents from Zoho CRM in three ways: by hand from the record, from a CRM workflow rule with a Deluge custom function, or from a Zoho Flow flow. Deluge is Zoho's own scripting language. Zoho Flow is Zoho's integration tool. In Flow, a trigger starts a flow and actions are the automated tasks that follow.

The table compares the three routes on what the pack documents.

RouteWhat starts itCode neededWhat it can do
Manual merge from the recordA user opens a record and starts a mergeNoneOne document at a time, through the temporary document
CRM workflow ruleA record meets the rule's conditionsA Deluge custom functionMerge and email, download, store, sign or invoke
Zoho FlowA Flow trigger, such as a lead being createdNone for the prebuilt flowsCreate a merged document, send it by email, or send it for signature

The Zoho Flow page for Writer and CRM shows three prebuilt flows. One creates a mail merge document when a CRM entry is created or updated. One creates and signs a merged document when a new lead is created. One creates merged documents and emails them when a new lead is created.

Choose Flow when a prebuilt flow already does the job. Choose a workflow rule when you need the store or invoke tasks, or tight control over which records qualify.

Zoho CRM workflow rules and Deluge custom functions for mail merge

A Zoho CRM workflow rule is a set of actions, such as email notifications and field updates, that run when specific conditions are met. To automate a Writer mail merge, you write a custom function in the Deluge script editor and associate it with the workflow rule. You need a Zoho CRM account with the manage workflow permission to do this.

The custom function can run five Writer mail merge tasks:

  • Merge and email: the zoho.writer.mergeAndSend task fills the merge fields and sends each merged document individually to the email address given.
  • Merge and download: produces the merged file for download.
  • Merge and store: merges the record data and saves the documents in a Writer folder automatically.
  • Merge and sign: merges the record data and sends the document for digital signature.
  • Merge and invoke: merges the record data and calls a custom function or workflow with the merged output.

Zoho's sample scripts show the settings you will change most. In the Merge and Store sample, output_format takes docx, pdfform or pdf. In the Merge and Sign sample, each signer's action_type is approve, sign or view.

Start from those published samples and change only the template, record and output values. Do not write the function from memory. When documents go for signature with CRM data, you can also obtain the signature status. For quotes in particular, our post on quote templates, approval and e-signature in Zoho CRM covers the approval side.

Five Deluge tasks let one workflow email, download, store, sign or hand on each merged document. What the task does / Choose it when. Merge and email: Fills merge fields, emails each document separately / Each client should receive their own copy at

Storing the merged document back on the Zoho CRM record

Post-merge operations are what put the finished document back on the CRM record. Post-merge operations are actions that Writer's merge templates run through custom functions once a merge completes. They can attach the merged document to a CRM record, create or update a CRM record with filled data, or attach filled data to a record.

To attach the merged document, follow these steps:

  1. Open the merge template and choose Merge & invoke custom functions as the output option.
  2. Open the Gallery and select the Attach to Zoho CRM custom function.
  3. Add the required connections, then click Save & Link function.

Fillable documents use a different route. You choose Merge & share fillable link, click Configure form submit actions, and select Trigger webhook & custom functions. The ID of the CRM record that receives the filled document sits in the record_data object of the fillInfo custom function parameter.

To write filled values into CRM fields, the Gallery offers Create Zoho CRM record and Update Zoho CRM Records. In the configuration dialog, replace the connection names with your own and click Proceed. Skipping that step is a common reason a function saves but never writes anything.

Before you automate document storage on records, check your retention and recovery approach. Our guide to backing up and restoring Zoho CRM data explains what a restore keeps.

Filing the merged document on the CRM record takes three template settings, then two tests. What you do / Where. 1. Set the output: Choose Merge & invoke custom functions / Writer merge template; 2. Pick the function: Select Attach to Zoho CRM / Writ

Worked example: a proposal PDF generated from a Zoho CRM deal

This worked example produces a proposal PDF whenever a deal reaches the proposal stage, and files the PDF on the deal. It uses only the settings described in Zoho's help pages. Field and stage names are examples; use your own.

Build the template

Create a Writer document called "Deals - Proposal PDF" with Zoho CRM as the data source and the Potentials module selected. Insert merge fields for the deal name, amount and closing date. Add the line-item subform fields as a table. Put the scope text in a rich text field so its formatting carries through.

Set the output

In the template, choose Merge & invoke custom functions. Pick Attach to Zoho CRM from the Gallery, add the connections and click Save & Link function.

Add the workflow rule

In CRM, create a workflow rule on Deals. Set it to run when the stage changes to your proposal stage. Associate a Deluge custom function built from Zoho's Merge and Invoke sample, with the output format set to pdf.

Test it

Move one test deal into the stage. Check that the PDF appears on the deal, every field has a value and the subform table shows every line.

Then test a deal with an empty field and a long subform before you switch the rule on for everyone.

Field-mapping mistakes that break Writer templates after go-live

Most Writer templates that fail after go-live fail on mapping, not on the workflow. The template worked on the record it was built with, and the real data then differs. At Svennis, the break we see most often is a template tested on one tidy record and never on a record with blank fields or a long subform. We now test every template against the messiest real records before any workflow is switched on.

The mistakes worth checking for are these:

  • Subform fields left out of the template, so the document shows no lines and an update cannot carry subform data back.
  • Connection names left at the Gallery defaults in the create and update functions, so the function saves but does not write.
  • Uncontrolled Update Template clicks, so one user's one-off edit becomes the standard wording.
  • Imported .docx layouts never cleaned in Writer, so spacing shifts as merged values change length.
  • Conditional sections built on If conditions that were never tested against each checkbox state.

Monitoring needs a plan too. Writer keeps mail merge logs on a job basis only. You see whether a merge job ran, not a history per record. A simple CRM field or tag set by the workflow gives you a per-record check that a document was produced.

What Writer document automation means for a UK company

For a UK company, the practical gain from Writer document automation is consistency. Every letter, proposal and label carries the same layout, the same wording and the same data as the CRM record. A document filed on the record is also easy to find when a client queries what they were sent.

Three points deserve attention before you go live.

Email delivery. Google's sender guidelines for Gmail and Google-hosted domains took effect on 1 February 2024. Zoho notes they can affect delivery of emails sent from Zoho Writer. Many UK clients use Google-hosted mail. Test the Merge and email task against a Gmail address before you rely on it.

Signatures. Writer sends documents that need signing to Zoho Sign. For engagement letters and proposals, the Merge and Sign task, with signers set to approve, sign or view, keeps the signing step on the same record.

Templates in British English. If your letterhead began life as a Word file, clean it in Writer first. Check the spelling, the address layout and any fixed text before you add a single merge field. Fixed wording is the part no merge field will correct.

If your CRM is still being set up, our page on Zoho CRM implementation in the UK explains how the modules and fields come together, so your templates have stable fields to map to.

Next steps for setting up Writer templates from Zoho CRM

The next step is to pick one document your team produces by hand every week and automate that one first. A proposal on a deal, or a welcome letter on a new contact, is a good candidate. It is frequent, it follows a fixed layout and it draws on fields you already keep.

Work through this order:

  1. List every field the document needs, including subform rows and rich text.
  2. Confirm those fields exist in CRM and are filled in on real records.
  3. Build the template in Writer and name it by module and purpose.
  4. Set the output to Merge & invoke custom functions with Attach to Zoho CRM.
  5. Add a workflow rule, or use a prebuilt Zoho Flow flow if one fits.
  6. Test on a blank-heavy record and a long-subform record, then switch the rule on.
  7. Agree who may click Update Template.

Expect the field list to take longer than the template. Gaps in CRM data show up here first, and fixing them helps every report as well as the document.

If you want help planning the build, our page on Zoho Writer document automation sets out how we approach templates and workflows with UK teams.

Sources

Looking for a Zoho partner in the UK? Svennis has been a Zoho Premium Partner since 2011, with more than 200 implementations delivered. See how we work as a UK Zoho Partner.