DocuMerge App Overview

For best implementation, it’s ideal to first understand the workflow of DocuMerge.AI. Your Data DocuMerge exists primarily as a means to send data from a 3rd party source and merge it into a template and output a document; PDF, Office Documents, Email Text, HTML, and Images. Think of like an an advanced “mail merge” to…

Image Description

For best implementation, it’s ideal to first understand the workflow of DocuMerge.AI.

Your Data

DocuMerge exists primarily as a means to send data from a 3rd party source and merge it into a template and output a document; PDF, Office Documents, Email Text, HTML, and Images. Think of like an an advanced “mail merge” to create address labels, except you can send large payloads, with thousands of variables, perform advanced logical operations during processing, and electronically deliver the generated document(s) to nearly anywhere.

You’ll typically send your data from a web form submission, a custom application, or CRM tool. But you can also manually submit data to your templates within DocuMerge. When sending your data from a 3rd party source, you’ll send data via a webhook (HTTP POST name/value pairs). When creating a DocuMerge document template or route, a unique, secure URL is created where you’ll send data to. It will look something like this: https://app.documerge.ai/merge/abcd_efg12

Whenever you send data to that URL, the data is processed and your document(s) generate.

Smarty Template Engine

Throughout DocuMerge (your document templates, routes, rules, settings, and deliveries) you’re able to call your data values and process advanced logical operations (if/else, foreach loops, math, etc) using the Smarty Template Engine.
For example, when submitting your data, one of your data variables may be: "user_id": "36"
To call the value (’36’ in this example submission) within DocuMerge fields or templates, you’d use: {$user_id}

A more advanced operation, like a loop on an array or object variable, could look like this:
{foreach from=$products item=_row}
{$_row.Quantity} x {$_row.Name} = ${$_row.Price|number_format:2}
{/foreach}

To learn more about operators, functions, formatting, loops, and Smarty statements, follow these links:

Documents

Your documents are generated from either custom built HTML templates, or an uploaded template (fillable PDF or office document). Document templates will contain the variables you wish to output, in the location and format you will to output them. Wherever a variable is present within the template, it is replaced with the value from your data. In HTML and office documents, you can also process advanced logical operations. Performing more advanced logical operations is helpful when you want to:

  • Loop through arrays/objects
  • Merge arrays/objects
  • Have sections of your template generate or be ignored based on your data
  • Format your data (datetime, truncate, math, rounding, replace, etc)
  • Determine what document template(s) to process, or external files to include, when generating documents

Each document template you add will have it’s own merge url (where you send your data to to trigger the document creation), and template specific settings for naming convention, delivery methods, field mapping, and file output type. Depending on the source of your template (DOCX vs PDF vs HTML), you’ll have more or less output options. Creating a custom HTML document template provides the most robust set of output options.

Continue here to learn more about document templates and respective settings.

Field Maps

When you send data to a DocuMerge Document or Data Route, DocuMerge will first process your data with any additional logic you’ve added in the Document or Route Field Map. By default, variables you’ve added to your existing document will show as a variable in the Field Map tab. Field mapping enables you to:

  • Create additional name/value pairs
  • Alter values of variables using simple and advanced Smarty functions

TIP: If you are creating additional custom variables local to DocuMerge or your template, we recommend you preface your variable with an underscore “_”. In other words, if you want to create a new variable within the DocuMerge app fields or template, we’d recommend using $_total instead of $total. In keeping this consistent, you’ll be able to easily recognize locally created variable names versus variable names you’ve sent in your initiating request.

Deliveries

When a document is generated, you’ll want that file delivered somewhere. DocuMerge integrates with a host of online platforms for this purpose. The most popular methods are webhook, Zapier, email, and SFTP. But we have delivery methods for popular CRMS like SalesForce, file storage apps like Dropbox, and signing tools like Adobe Sign. And we’re consistently adding to our delivery methods. Please contact us if there’s a delivery method critical to your workflow that we have not yet integrated.

Delivery methods can be setup under specific Documents or Routes. Every time you trigger a Document or Route merge, any delivery methods configured will fire with the file payload, and in instances like webhook, can contain the name/value pairs of the entire submission. It should be noted, that when triggering one or more Documents from a Route, any delivery methods configured for those Documents will also trigger.

Continue here to learn more about document templates and respective settings.

Data Routing and Rules

Like Document Templates, setting up a Data Route will provide you with a Merge URL (where you post your data to trigger the merge). It will look something like this: https://app.documerge.ai/route/abcd_123ab Data Routes will also have the same Field Map for data preparation/alteration prior to merge, as well as Settings.

What is unique to Data Routes is the power of Rules. Under a newly configured Data Route, you’ll find a Rules tab that will allow you to a couple of unique tasks:

1. CONDITIONAL LOGIC

When you submit data to a Route, we’ll first run the data through the Field Map for any customizations you may have created, and then run the Rules. With rules you can determine when to enact a merge event, or which template(s) to merge with, based on your variables. For example, you may have 2 Document Templates that are contracts, but wish to use 1 contract template for a certain type of client, and the other contract template for all other clients. As such, you will setup 2 rules:

2. COMBINE FILES

In other cases, you may wish to join external files or other Document Templates into a single file output, resulting in a single multi-page PDF or DOCX document for delivery. In the example below, when the route is triggered, it will generate 2 multi-page documents for delivery from the Data Route. One will be a PDF, combining a local DocuMerge Document with an externally hosted file, while the other is a multi-page DOCX document from two local DocuMerge Documents.

Continue here to learn more about document templates and respective settings.

API

We’ve developed a robust API that allows you to manage your documents and routes. You can also utilize a few useful document tools directly for:

  • Combine Documents
  • Document Compression
  • File Type Conversion
  • Document Encryption
  • Document Splitting

View our API documentation at: https://app.documerge.ai/api-docs

FormStack Documents Migration

After using us as a backup for FormStack Documents downtime, we’ve had many customers make the switch entirely from FormStack Documents (yes, we’re cheaper!), and we’ve made it easy to do so. With only a few clicks you can migrate your entire suite of documents and routes, along with nearly all existing configurations. We’ll walk you through it here.

Was this article helpful to you?

Yes No

Related Articles