Document Generation with Document Nodes (PDF or HTML)

  • Updated

Many Zingtree customers want to create a final, single-page document based upon answers to decision tree questions. Zingtree’s Document Nodes make this powerful custom document generation capability a reality.

With the help of Document Nodes, you can now complete tasks like:

  • Making custom sales brochures or product recommendations.
  • Building legal agreements.
  • Generating purchase orders.
  • Creating evaluations and assessments.
  • And lots more…

For a simple example, examine the Document Nodes Demo: Building a personalized custom output decision tree from the Zingtree Gallery.

You can also provide PDF files or HTML Files as a download option, or as a link to include in an email.

Document Nodes Overview

Document Nodes display the content from one or more content nodes on a single page, based on variables and values. Variables can be from one of these sources:

  • Data Entry field values.
  • Scoring variables from button clicks.
  • Variables set from Data Entry field list boxes or radio buttons.
  • Variables introduced from calls to Webhooks.
  • Merge Variables passed into the session.

Here’s how it looks in the Document Node editor:


You can also include variables in the Value column to compare two variables. For example, enter #age# to use the value of an age variable as a comparison.

Building a Tree to Generate a Document

To build a decision tree that generates a document based on the answers selected, we recommend these steps:

  1. Create your question nodes, and assign Button Click Variables to important responses.
  2. Create content nodes (with no button options) for all of the possible snippets of content you’ll want to show in the final document.
  3. Create a document node that pulls everything together.

Set Up: How to Create a Document Node

Here’s how to create a fully-functional Document Node, step-by-step:

  1. From your tree, click Add Node.
  2. Select New Document Node.
  3. Add individual Content Nodes that will serve as the pieces of your final document.
  4. Each piece of content is set up like the image shown below. In this example, if the variable vehicle equals “Motorcycle”, we add the contents of node #3 to the final document.


If you have content you want always to be included in your document (like a heading for example) you can choose always include and select the node with the content you want to be included. 


Using the Document Node Editor

In the final document, the content will appear in the order they are in the list. Drag this to reorder the content:


Click this to delete the content from the document node:



In the example below, the document node will include the content of the Motorcycle node if the vehicle variable equals Motorcycle. 


The Variable drop-down options will display all of the variables you are collecting in your tree. 


Pick an operation:


Enter a value (or variable) to test against:


Choose the node to display if the rules match:



Using Advanced Logic

To create more complicated logic for including nodes, tick the Using Advanced Logic Expressions option. Now you can write complex expressions that can include AND's and OR's. 


You can see a full reference on Advanced Logic Operations here.

Continuing On After Creating a Document

Add a “Next” button to the top Document Type section of the document node, and have the end-user continue on to another node after viewing the generated document. Just configure your document node as you see here:

Making PDF or HTML Versions Available

You can provide PDF  versions of a generated document in two ways:

  • As a “Download PDF” button when the document node appears.
  • As a document URL, uploaded to the Zingtree servers.

Making an HTML file for download is also possible – a “Download HTML File” button can appear.


Download PDF button option

Here’s how a document node can appear with a “Download PDF” button:


This can be configured in the Document Node editor in the Document Type section like this:

PDF File Naming: The downloaded PDF filename uses the title of the document node. You can also include variables in this title (i.e. #name#) to further customize the name of the PDF file.

PDF or HTML URL option

The other option is to have Zingtree generate a PDF or HTML file, upload it to a server, and create a link to the file as a Zingtree variable. Here’s how that’s set up in the Document Node editor:

  1. Open the Document Type menu
  2. Select Make PDF File URL variable or Make HTML File URL variable..
  3. Enter a File URL variable. This variable will contain the URL for your PDF or HTML file.
  4. Select a node to go to once the file has been generated.

In the above example, the variable html_file_url will contain the URL of the HTML file generated by this document node. See this article to learn how to make links in emails or content nodes to a PDF document URL.

Note that in this setup, the end-user will not see their document node until they open the URL.

PDF hint: Pagination

If you want to force a page break, add ##PDF Page## anywhere in the content area of a node.

“Downloading HTML File” Button

Another option is to include a button for downloading an HTML file rendering of the document node. These can then be edited in Google Docs, MS Word or any other system that can read HTML.

Just set up your document node like so:



Was this article helpful?

0 out of 1 found this helpful

Have more questions? Submit a request

Didn't find what you need?

Our friendly customer support team is here to help

Submit a Ticket

Looking for help or advice?

Reach out to our knowledgeable community of users.

Zingtree Community