Updated August 6, 2020, with HTML File URL variable as a new option.
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 What Computing Device Do I Need? decision tree from the Zingtree Gallery.
You can also provide PDF files or HTML Files (which can be read by Google Docs or MS Word) as a download option, or as a link to include in an email.
This companion video illustrates how document nodes work, and how to create and edit them:
Document Nodes Overview
Document Nodes display the content from one or more content nodes on a single page, based upon 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 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 Overview, click Add Node.
- Select New Document Node.
- Add the pieces of content you want to serve to your end-users.
Each piece of content is set up like the image shown below. In this example, if the variable phone_calls equals “Yes”, we add the contents of node #6 to the final document.
Using the Document Node Editor
Drag this to reorder the content:
Click this to delete the content from the document node:
Pick a variable to test:
Pick an operation:
Enter a value (or variable) to test against:
Edit and show the contents of the included node:
Hint: Once the content a node is inserted in the document, it won’t be re-inserted again.
Using Advanced Logic
To create more complicated logic for including nodes, tick the Using Advanced Logic Expressions option. The current logic will be converted to expressions, which can be more complicated, and include AND, OR, parenthesis and more.
Continuing On After Creating a Document
You can 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 like 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 the Recent Sessions tool.
- 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:
You need to do these three steps:
- Click the Interface tab
- 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:
The What Computing Devices do I Need tree demonstrates a simple tree with a Document Node at the end. This tree helps an end-user decide whether they need a phone, tablet or desktop PC, based on the answers to some questions.
Have any questions, comments, or suggestions on this feature? Talk to us on live chat or by email!
This article was originally published on November 29, 2016, and updated on August 6, 2020.