Generate Documents

Dynamically Generate documents using the PDF4me Generate Documents action for Zapier. Use Word or HTML templates using mustache syntax or merge fields as the source. The data sources can be JSON or XML.

Also, we have shared a zap to ease your setup.

Parameters

Template FileFile, Required

A template file for generating documents.

Template File NameString

Name for the output file.

Template TypeOptions, Required
Default: Word

Template file type.

  • Word - Set this value when sending Word template
  • HTML - Set this value when sending HTML template
Input DataString, Required

Text containing dynamic data values for merging with the template

in this field, we map template file data and prepare data string with PDF4me Generate Document action. The data string is assigned with string function as mentioned below.

Sample Json Structure (List Object)::

{
  "Documents":
  [
    {
      "FieldName1": "FieldValue1",
      "FieldName2": "FieldValue2",
      "FieldName3": "FieldValue3"
    },
    {
      "FieldName1": "FieldValue4",
      "FieldName2": "FieldValue5",
      "FieldName3": "FieldValue6"
    },
  ]
}

Documents – It’s a declared variable that contains list items in a prepared format. You can also append the JSON as shown below

QrCode

Input Data TypeOptions, Required
Default: Json

Data type for the template

  • Json
  • Xml
Output Document TypeOptions

The output type of generated documents

  • PDF
  • Word
  • Excel
  • Html
Meta DataString

JSON string User can specify fields that need some format.

Eg: Date

{ 
  "FieldsMetaData":
  [
    {
       "FieldName":"dueDate",
       "FieldType":2,
       "FieldFormat":“yyyyMMdd”
     }
   ] 
}

Here FiledType is an enum having the below values

CheckBox = 0,
Html = 1,
DateTime = 2

Output

The output of the action is an array of documents. To read it one by one, you can use Loop By Zapier. This Zapier step is in the beta version.

File NameString

File name of the file without extension

File ExtensionString

File Extension

Full File NameString

Name of the file including extension

File URLString

URL containing generated document

File SizeNumber

Size of the document

Generate Document Action