Skip to main content

Generate Document Single in Zapier

Generate Document Single is a Zapier action by PDF4me that merges a Word, HTML, Mail Merge, or Google Docs template with JSON or XML data to produce one completed document. Use it to turn CRM records into contracts, order data into invoices, or form submissions into certificates, all inside a Zap.

Related Blog Posts(1)

What this action does

PDF4me Generate Document Single takes one template file and one set of data and returns one merged document, inside a Zap. Map a Word, HTML, PDF, Mail Merge, or Google Docs template, supply data as inline text or a data file, and choose the output format. Ideal for contract generation, invoice creation, certificate issuance, offer letters, and any workflow that turns one record into one document without writing merge code.

Authenticating Your API Request

To access the PDF4me Web API, every request must include proper authentication credentials. Connect your PDF4me account once in Zapier and every Generate Document Single step in your Zaps reuses it.

Important Facts You Should Not Miss

Input Data Format Type decides which data field is required
Set it to Text and Data Text becomes the required field for inline JSON/XML. Set it to File and Data File becomes required instead, for a data file mapped from a previous step. The other field stays hidden until you switch the toggle.
Template File Type is not limited to Word/HTML/PDF
The dropdown also includes Mail Merge (a Word template built for mail-merge fields) and GoogleDocs (a Google Docs export used as a merge template), confirmed in live Zap configurations. Match this value to how the template file was actually built.
Run it twice for two output formats
One template can feed two Generate Document Single steps with different Output Document Type values (for example Pdf then Docx) to produce both a locked copy and an editable copy from a single trigger.
Generate Document in PDF4me action panel in Zapier showing Template File, Template File Name, Template File Type set to PDF, Input Data Format Type set to Text, Data Text, Input Data Type set to Json, and Meta Data fields

Set up action panel with Input Data Format Type set to Text, revealing the Data Text field

Parameters

Required in the Zapier UI: Template File, Template File Type, Input Data Format Type, Input Data Type, and (depending on Input Data Format Type) either Data Text or Data File. Template File Name, Output Document Type, Keep Pdf Editable, and Meta Data are optional.

ParameterRequiredWhat it doesExample
Template FileRequiredTemplate file to populate. Map it from a previous step (Dropbox, Google Drive, Upload File).template.docx
Template File NameOptionalName for the output file. If left blank, the name is picked from Template File's own filename.contract_template
Template File TypeRequiredFormat of the template: Word, HTML, PDF, Mail Merge (Word built for mail-merge fields), or GoogleDocs (Google Docs export).Mail Merge
Input Data Format TypeRequiredWhether data is supplied as inline text or a file. Text reveals Data Text. File reveals Data File.Text
Data TextConditionalInline JSON or XML string to merge into the template. Required when Input Data Format Type is Text.[{"firstname":"John","lastname":"Adams"}]
Data FileConditionalData file (JSON or XML) mapped from a previous step. Required when Input Data Format Type is File.data.json
Input Data TypeRequiredStructure of the supplied data, must match Data Text or Data File exactly.Json
Output Document TypeOptionalFormat of the generated document: Pdf, Docx, and other supported formats.Pdf
Keep Pdf EditableOptionalWhen the output is a PDF from a fillable template, keeps its form fields interactive instead of flattening them.false
Meta DataOptionalMetadata to attach to template fields during generation.-

Output

FieldTypeWhat it contains
File NameStringFile name of the generated document, without extension.
File ExtensionStringExtension of the output document, matching Output Document Type.
Full File NameStringComplete filename including extension.
File URLStringDirect URL to the generated document, map this into an Upload File, email, or storage step.
File SizeNumberSize of the generated document in bytes.

How Do I Set Up Generate Document Single in Zapier?

  1. Add PDF4me as the action app in your Zap and choose Generate Document.
  2. Connect your PDF4me account or select an existing connection.
  3. Map Template File from a previous step and set Template File Type to match it (Word, HTML, PDF, Mail Merge, or GoogleDocs).
  4. Set Input Data Format Type to Text and fill Data Text with inline JSON/XML, or set it to File and map Data File from a previous step.
  5. Set Input Data Type to Json or Xml to match your data's actual format.
  6. Optionally set Output Document Type and Keep Pdf Editable, then test the step.
  7. Map the returned File URL into an Upload File, Gmail, or storage action to deliver the generated document.

Typical Setups

Workflow ExamplesCommon Zapier patterns using Generate Document Single.
Mail Merge template with a JSON data file
  1. A new file lands in a watched Dropbox folder (the Word template).
  2. A Find a File step locates the matching JSON data file in the same folder.
  3. Generate Document Single runs with Template File Type Mail Merge, Input Data Format Type File, Data File from the find step, Input Data Type Json.
  4. An Upload File step saves the generated document back to Dropbox.
Google Docs template, inline JSON, dual output
  1. A Find a File step locates a Google Docs template exported as .docx.
  2. Generate Document Single runs with Template File Type GoogleDocs, Input Data Format Type Text, Data Text as an inline JSON array, Output Document Type Pdf.
  3. A second Generate Document Single step reuses the same template with Input Data Format Type File and Output Document Type Docx, producing an editable copy alongside the PDF.
CRM record to contract, triggered by a webhook
  1. A Webhooks by Zapier trigger receives a new-deal payload from a CRM.
  2. A Formatter step shapes the payload into the JSON structure the contract template expects.
  3. Generate Document Single runs with Template File Type Word, Input Data Format Type Text, Data Text from the Formatter step, Input Data Type Json, Output Document Type Pdf.
  4. A Gmail step emails the generated contract to the client.
HTML template for a lightweight certificate
  1. A course-completion trigger fires from a learning-management webhook.
  2. Generate Document Single runs with Template File Type HTML, Input Data Format Type Text, Data Text holding the learner name, course, and date, Output Document Type Pdf.
  3. An Upload File step saves the certificate to a shared drive folder for the learner.

Practical Tips

Match Template File Type to how the template was built
Word for a plain merge-field .docx, Mail Merge for a template designed around the mail-merge field pattern, GoogleDocs for a Google Docs export. Picking the wrong type can leave placeholders unfilled.
Toggle Input Data Format Type before filling in data
Data Text and Data File are mutually exclusive: only the field matching your Input Data Format Type selection is required. The other stays out of the way.
Input Data Type must match your data exactly
Json for JSON data, Xml for XML data. A mismatch causes template fields to bind incorrectly or come back empty.
Run twice for two formats from one template
Set Output Document Type to Pdf in one step and Docx in a second step using the same template and data to get both a locked and an editable copy.
Use Keep Pdf Editable only for fillable-PDF templates
This toggle only matters when the template is itself a fillable PDF and the output is Pdf. It has no effect on Word, HTML, or Mail Merge templates.
Batch runs need Generate Documents Multiple, not this action
This action produces one document per run. To generate many personalized documents from one template and a list of records in a single step, use Generate Documents Multiple instead.

Cheat Sheet

FieldValue
ActionGenerate Document
Template FileFrom a previous step
Template File TypeWord / HTML / PDF / Mail Merge / GoogleDocs
Input Data Format TypeText or File
Data TextRequired when Input Data Format Type is Text
Data FileRequired when Input Data Format Type is File
Input Data TypeJson or Xml
Output Document TypePdf, Docx, and other supported formats
Keep Pdf Editablefalse (default behavior in documented workflows)

What Should I Use Instead of Generate Document Single?

If your workflow needs many personalized documents from one template and a list of records in a single run, rather than one document per Zap run, use Generate Documents Multiple. If your template is a fillable PDF form rather than a mustache/merge-field template, use Fill a PDF Form to populate its AcroForm fields directly instead of running it through the template engine.

Common Questions

What is the difference between Data Text and Data File?+
Input Data Format Type controls which field is required. Text reveals Data Text for inline JSON or XML, useful when a prior step already exposes the data as text such as a webhook body or a Formatter step output. File reveals Data File for a data file mapped from a previous step, such as a downloaded JSON file. Only the field matching your selection is required at a time. See <a href="https://zapier.com/blog/create-documents-from-templates/" target="_blank" rel="noopener noreferrer">Zapier's own guide on building documents from templates</a> for background on template-merge workflows.
What template types does Generate Document Single support?+
Template File Type accepts Word (.docx with mustache or merge-field placeholders), HTML (.html with template placeholders), PDF (a PDF layout template), Mail Merge (a Word template built around the mail-merge field pattern), and GoogleDocs (a Google Docs export used as a merge template). Match this value to how the template file was actually authored.
What does Keep Pdf Editable do?+
Keep Pdf Editable applies only when the output is a PDF generated from a fillable-PDF template. Left off, the generated PDF is a static, completed document. Turned on, it preserves interactive form fields in the output so a recipient can still edit values after the document is generated.
What output formats can Generate Document Single produce?+
Output Document Type sets the generated file's format independently of the template format, options include Pdf and Docx among other supported formats. Running the same template through the action twice with different Output Document Type values produces both a PDF and a Word copy from one source, a pattern documented in PDF4me's own Zapier trigger workflows.
Do I need to specify Input Data Type as Json or Xml?+
Yes. Input Data Type is required and must match the actual structure of the data supplied in Data Text or Data File. A mismatch, such as selecting Json for XML-formatted data, causes the template engine to fail to bind fields and the generated document returns with placeholders unfilled. For background on JSON structure basics, see <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON" target="_blank" rel="noopener noreferrer">MDN's JSON reference</a>.

Same Task on Other Platforms

Industry Use Cases & Applications

  • Contract Generation: Create personalized contracts from templates with client data
  • Legal Document Creation: Generate legal documents with case-specific information
  • Agreement Processing: Automate agreement creation with dynamic data integration
  • Document Automation: Streamline legal document workflows with template processing

Get Help