Skip to main content

Generate Documents in Make

What this module does

PDF4me – Generate Documents merges JSON or XML data into a Word or HTML template and returns the result as a finished PDF, Word document, or Excel file — ready to email, store, or continue processing. Place {'{{fieldName}}'} placeholders in your template, supply matching key-value data, and the module performs the substitution entirely server-side. It is the legacy document generation module — for new scenarios with complex conditional logic or loop structures, use Generate Document Single instead, which supports the full PDF4me LINQ template syntax.

Authenticating Your API Request

Every PDF4me module in Make requires a valid Connection. Create or select one that holds your PDF4me API key so the scenario can authenticate document generation requests securely.

Important Facts You Should Not Miss

Template Name is the filename — not a dashboard template ID
The Template Name field expects the filename of the template file (e.g. invoice_template.docx), mapped from the File Name output of your Dropbox, Google Drive, or OneDrive download step. It is not a template ID from the PDF4me dashboard — the actual template binary is supplied separately via Document Data File.
Data can be text or a file — both work
You can supply merge data in two ways: paste or map a JSON/XML string directly into Document Data Text (good for small payloads built from prior module outputs), or map a binary JSON/XML file from a storage module into Document Data File (better for large or externally maintained data files). If both are populated, the file takes precedence.
For multiple records, use Generate Document Multiple instead
Generate Documents produces a single output document per run. If your data contains an array of records (e.g. 50 invoice records) and you need one document per record, use Generate Document Multiple — it iterates the array and returns a ZIP of all generated files in a single module call, eliminating the need for an iterator loop.
Make PDF4me Generate Documents module showing Connection set to testuser01@pdf4me.com, Template File Type dropdown set to Word, Output Type dropdown set to Word, File set to Map with Template Name mapped from 7. File Name and Document Data File mapped from 7. Data, Document DataType set to Json, Document Data Text with example JSON array, and Meta Data Json field

Set Template File Type and Output Type first, then wire Template Name and Document Data File from the step that downloaded the template. Supply merge data via Document Data Text or Document Data File.

Parameters

Required: Connection, Template File Type, Output Type, Template Name, and Document DataType. Set File to Map first to reveal Template Name and Document Data File.

ParameterRequiredWhat it doesExample
ConnectionYesPDF4me API connection. Click Add and paste your API key to create one.[email protected]
Template File TypeYesFormat of the template file. Options: Word (DOCX) or html. Has a Map toggle for dynamic scenarios. Hint: "Select Template file type."Word
Output TypeYesFormat of the generated output. Options: Pdf, Word, or Excel. Has a Map toggle. Choose based on the recipient's needs.Pdf
FileNoHow the template is supplied. Choose Map to wire Template Name and Document Data File from a prior module. Choose Dropbox – Download a File for a direct Dropbox trigger.Map
Template NameYesFilename of the template including extension (e.g. invoice_template.docx). Hint: "Template file name." Map from the File Name output of your download step.7. File Name
Document Data FileNoBinary content of a JSON or XML data file from a storage module. Hint: "Map source document file content from the previous action." If both this and Document Data Text are supplied, this file takes precedence.7. Data
Document DataTypeYesFormat of the data source. Options: Json or Xml. Has a Map toggle. Hint: "Choose Document Data Type."Json
Document Data TextNoJSON or XML data as a text string — paste a literal payload or map from a prior module output. Hint: "Input Data text to generate document." Example: [{"name":"John"},{"name":"Jane"}][{"name":"John"}]
Meta Data JsonNoOptional JSON for field formatting. Use FieldType 2 for date fields, FieldType 0 for checkboxes, FieldType 1 for HTML content. Hint: "MetaData for Fields."{"FieldsMetaData":[...]}

Output Fields

FieldTypeWhat it contains
NameStringFilename of the generated document. Map into the file name field of your storage upload or email step.
Doc DataBufferBinary content of the generated PDF, Word, or Excel file. Wire directly into a Create file action in SharePoint, Google Drive, Dropbox, or OneDrive, or attach it to a Gmail send action.

Quick Setup

  1. Add PDF4meGenerate Documents to your Make scenario.
  2. Select Connection (or click Add to create one with your API key).
  3. Set Template File Type to Word or html to match your template format.
  4. Set Output Type to Pdf, Word, or Excel for the desired output.
  5. Set File to Map, then wire Template Name to the filename output and Document Data File to the binary content of your template download step.
  6. Set Document DataType to Json or Xml. Enter or map your data in Document Data Text, or leave it empty if the data is already wired via Document Data File.
  7. Save and click Run once. The Doc Data output holds the finished document — wire it into a storage upload or email step.

Workflow Examples

Workflow ExamplesCommon Make scenario patterns using Generate Documents.
New order → generate PDF invoice → email customer
  1. A webhook fires when a new order is confirmed in Shopify or WooCommerce.
  2. Google Drive downloads the invoice_template.docx stored in the team drive.
  3. Generate Documents merges the order payload (customer name, line items, total, due date) into the template with Template File Type set to Word and Output Type set to Pdf.
  4. The Doc Data PDF is attached to a Gmail message sent to the customer immediately.
  5. A second Gmail uploads a copy to a "Invoices/2026" folder in Google Drive for accounting records.
Weekly report → generate Word doc → distribute to team
  1. A scheduled scenario triggers every Monday morning and queries Google Sheets for last week's KPI data.
  2. A Make text module assembles the sheet data into a JSON object with fields matching the report template placeholders.
  3. Generate Documents merges the JSON into the Word report template with Output Type set to Word.
  4. The Doc Data Word document is emailed to the management team as an editable attachment before the 9 AM standup.
Form submission → generate certificate PDF → archive
  1. A Typeform training completion form triggers the scenario with participant name, course, and date.
  2. Dropbox downloads the HTML certificate template stored in the team account.
  3. Generate Documents merges the participant data into the HTML template with Template File Type set to html and Output Type set to Pdf.
  4. The certificate PDF is emailed to the participant and uploaded to a SharePoint "Certificates" library for compliance records.

Frequently Asked Questions

What is the difference between Generate Documents and Generate Document Single?+
Generate Documents is the legacy module supporting mustache-style {{fieldName}} placeholders with JSON or XML data, and can output PDF, Word, or Excel. Generate Document Single is the newer recommended module for the PDF4me LINQ Reporting Engine syntax — supporting <<foreach>> loops, <<if>> conditionals, <<var>> variables, and running totals. For new scenarios with complex template logic, use Generate Document Single. Use Generate Documents when you have existing mustache templates, need XML as the data source, or need Excel output.
Can I supply data as a file instead of pasting JSON into Document Data Text?+
Yes — use the Document Data File field and map the binary content of a JSON or XML file downloaded from Google Drive, Dropbox, OneDrive, or an HTTP request. This is the preferred approach for large data payloads or when the data file is managed separately from the Make scenario. If both Document Data File and Document Data Text are populated in the same module run, the file takes precedence and the text field is ignored.
What template syntax does this module support?+
For Word templates, use double-brace mustache placeholders: {{fieldName}} for text substitution. For HTML templates, use the same {{fieldName}} syntax inside HTML elements. The module does not support the PDF4me LINQ Reporting Engine syntax used by Generate Document Single — tags like <<foreach>>, <<if>>, and <<var>> are not processed by this legacy module. Keep templates to simple flat field substitution; for loops and conditionals, switch to Generate Document Single.
What is Meta Data Json used for?+
Meta Data Json is an optional parameter for controlling how specific template fields are formatted during the merge. Set FieldType to 2 with a FieldFormat string (e.g. "yyyyMMdd") for date fields, FieldType 0 for checkbox fields that should render as ticks or checkboxes, and FieldType 1 for fields that contain raw HTML content. The structure is {"FieldsMetaData":[{"FieldName":"dueDate","FieldType":2,"FieldFormat":"yyyyMMdd"}]}. Leave the field empty for plain text substitution with no special formatting.
Can I output Excel from a Word template, and what are the limitations?+
Yes. Set Template File Type to Word and Output Type to Excel to receive an Excel workbook as output. The module converts the merged Word document to XLSX. This works well for tabular data where the Word template is laid out as a table — each row maps to an Excel row. Complex Word formatting such as multi-column sections, text boxes, and advanced styles may not translate cleanly to Excel cells. Test your specific template before deploying to production.

Get Help