Many Zingtree customers want to create a final, single-page document based upon answers to decision tree questions. Zingtree’s Document Nodes makes this powerful 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:
- Create your question nodes, and assign Button Click Variables to important responses.
- Create content nodes (with no button options) for all of the possible snippets of content you’ll want to show in the final document.
- 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:
- From your tree, click Add Node.
- Select New Document Node.
- Add individual Content Nodes that will serve as the pieces of your final document.
- 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 bottom 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:
You can examine any session and see why and how a document was generated. Here’s how to do it:
- Go to Usage Reports and pull a Session List report to show you recent sessions of your tree.
- Click on a session to examine it.
- Click the Debug Document button at the step where the document was created:
- This opens the document node debugger, with the variables set at that step filled in.
- Edit the variables if you like, and click Perform Document Node Test. You’ll see why each part of the document was included or excluded.
- You can repeat the tests using different variables.
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.
Please note that any PDF file generated is charged to you at $0.01 USD per 500 Kb.
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 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:
- Open the Document Type menu
- Select Make PDF File URL variable or Make HTML File URL variable..
- Enter a File URL variable. This variable will contain the URL for your PDF or HTML file.
- 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: