Skip to main content

Generate Document Using Template in Make

Generate Document Using Template is a PDF4me module for Make that merges a saved template from your PDF4me repository with JSON, XML, or CSV data and returns a finished document. Pick the template by name, map your data inline or as a file, and generate invoices, contracts, and letters without uploading a template file each run.

What this module does

PDF4me Generate Document Using Template generates a document by merging a template stored in your PDF4me repository with data you supply as JSON, XML, or CSV. Unlike file-based generate modules, you select the template by name from a dropdown, no template upload or mapping required. Provide data inline via Document data text or as a mapped file via Document data file, add optional field formatting with Metadata JSON, and pipe the generated document into Upload File, Send Email, or any downstream Make module.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

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 a repository template, not a file
The Template name dropdown lists templates saved in your PDF4me repository. You pick a stored template by name instead of uploading or mapping a template file. Use the click here link beside the field to open the repository and create or edit a template.
Supports JSON, XML, and CSV data
Set Document data type to Json for an object or array, Xml for XML documents, or Csv for comma-separated rows. The chosen format applies to whichever source you use, Document data text or Document data file.
Provide either Data Text or Data File
Supply your data one of two ways: paste or map it inline into Document data text (good for CRM fields and small payloads), or map a binary data file into Document data file (good for larger or externally maintained data). You do not need both.
Make PDF4me Generate Document Using Template module showing Connection set to My PDF4me connection, Template name set to sample template selected from the PDF4me repository, Document data type set to JSON, Document data text holding a four-field JSON object, and empty Document data file and Metadata JSON fields

Pick a saved template in Template name, set Document data type, and supply data via Document data text or Document data file. Required fields are marked with a red asterisk.

Where do the templates come from?​

The Template name dropdown is populated from the Document Template area of the PDF4me dashboard. Templates live in your account, not in the Make scenario, so you build one once and reuse it across every scenario, flow, and API call.

PDF4me dashboard Document Template page listing three saved templates in a table with Template Name, Template Type, Output File Type, and Actions columns: User Form as a PDF Form producing PDF, Daily Report as HTML producing HTML, and Invoice Word Template as PDF4me Word producing PDF, with an Add button above the table and edit and delete icons per row

Every template you save here appears in the Template name dropdown in Make. Click Add to create one, or the pencil icon to edit an existing template.

Each row in this table maps to one entry in the Make dropdown:

ColumnWhat it means in Make
Template NameThe exact text you select under Template name. Give templates distinct names so the dropdown stays readable at scale.
Template TypeThe source format you authored the template in, for example PDF Form, HTML, or PDF4me Word. This is fixed on the template, so Make never asks you for it.
Output File TypeThe format the generated document comes back as, for example PDF or HTML.
ActionsEdit or delete the template. Renaming a template changes the value shown in the Make dropdown, so update any scenario that referenced the old name.
This is why the module has no Output Type field

Both the template format and the output format are decided here, on the template itself. That is why Generate Document Using Template only asks for a template name and your data. If you need the same content as a different output format, save a second template with a different Output File Type.

Rename with care

The module stores the template name, not an id. If you rename a template in the dashboard, any Make scenario still pointing at the old name will fail until you reselect it. Use the Map toggle on Template name if you need to pass the name dynamically instead.

What parameters does Generate Document Using Template use in Make?​

Required: Connection, Template name, and Document data type. Conditional: Document data text OR Document data file (one must carry the data payload). Optional: Metadata JSON. For data format standards, see RFC 4180 for CSV and the official JSON specification.

ParameterRequiredWhat it doesExample
ConnectionRequiredPDF4me connection for the scenario. Click Add to create one with your API key, or select an existing connection.My PDF4me connection
Template nameRequiredDocument template chosen from your PDF4me repository. Pick a saved template from the dropdown. Use the click here link to open the repository and create a new template. Has a Map toggle for dynamic selection.sample template
Document data typeRequiredFormat of the data payload. JSON for object/array, XML for XML documents, CSV for comma-separated rows. Has a Map toggle.JSON
Document data textConditionalMap the fields from a CRM or prior steps as JSON, XML, or CSV text. Use this field when you are not uploading a data file.{ "name": "John" }
Document data fileConditionalMap a file containing the document data in JSON, XML, or CSV format. Use this instead of Document data text when the data comes from a download or upload module.2. Data
Metadata JSONNoOptional JSON that controls field formatting during the merge, for example date formats or checkbox and HTML field types. Leave empty for plain text substitution.{"FieldsMetaData":[...]}

Output​

The module returns one bundle per run containing the generated document, ready for downstream Make modules.

FieldTypeWhat it contains
DocumentFile (binary data)Content (binary data) of the resulting generated document, returned on docData. Map it together with File Name into the next module, for example Upload a File or Send Email Attachment.
File NameFile nameFile name of the resulting generated document, returned on name. Map it together with Document into the next module, for example to upload or email the file.

How do I set up Generate Document Using Template in Make?​

  1. Add PDF4me and select Generate Document Using Template.
  2. Select Connection (or click Add to create one with your API key).
  3. Open the Template name dropdown and pick a saved template from your PDF4me repository. If the list is empty, create one first at Document Template in the dashboard, or use the click here link beside the field.
  4. Set Document data type to Json, Xml, or Csv to match your data.
  5. Supply the data: paste or map it into Document data text, or map a data file into Document data file.
  6. Optionally add Metadata JSON for date, checkbox, or HTML field formatting.
  7. Click Save and run. Map the generated Document Data output into an Upload File, Send Email, or archive module.

Workflow Examples​

Workflow ExamplesCommon Make scenario patterns using Generate Document Using Template.
CRM deal to invoice from a saved template
  1. A CRM webhook fires when a deal is won.
  2. Generate Document Using Template selects the saved invoice template and reads the deal fields as JSON in Document data text.
  3. The generated invoice is emailed to the customer and stored in the deal record.
CSV export to batch letters
  1. A scheduled trigger downloads a CSV export from cloud storage.
  2. Document data type is set to Csv and the file is mapped into Document data file.
  3. The saved letter template is merged and each generated document is archived to a dated folder.
Formatted contract with Metadata JSON
  1. A form submission provides contract data as JSON.
  2. Metadata JSON sets the effective date field to a yyyyMMdd format during the merge.
  3. The saved contract template is generated and routed for e-signature.

Frequently Asked Questions​

How is Template name different from the file-based generate modules?+
In Generate Document Using Template, Template name is a dropdown that lists the templates saved in your PDF4me repository. You select a stored template by name instead of uploading or mapping a template file, so no File Type or Output Type fields are needed. Create or edit templates from the PDF4me dashboard.
What data formats can I supply?+
Document data type accepts Json for an object or array, Xml for XML documents, or Csv for comma-separated rows. Choose the format that matches your source data, then supply it via Document data text or Document data file.
Should I use Document data text or Document data file?+
Provide one of the two. Use Document data text to paste or map data inline from a CRM or a prior module. Use Document data file to map a binary data file. The file option is best for larger or externally maintained payloads.
What is Metadata JSON used for?+
Metadata JSON is optional and controls how specific template fields are formatted during the merge, for example date formats or checkbox and HTML field types. Leave it empty for plain text substitution.
How do I create a template for this module?+
Create it in the Document Template area of the PDF4me dashboard at https://dev.pdf4me.com/dashboard/#/document-template/ . Click Add, choose the Template Type (PDF Form, HTML, or PDF4me Word) and the Output File Type, then save. The template then appears in the Template name dropdown in Make. The click here link next to the field opens the same page.

Get Help​