Form Fields: Decision Trees with Data Entry

  • Updated

With Zingtree’s data entry, you can do things like…

  • Add form fields to your trees (text, list boxes, check boxes, radio buttons, dates and numbers).
  • Include form data dynamically in other parts of the tree (i.e. you can ask for a name in the first node, and have that name appear in other parts of the tree).
  • Export form data into any other system, including Help Desk or CRM applications.
  • Validate email and phone numbers, as well as USPS addresses.

For example, your decision trees can gather data like this:

How to Include Data Entry Fields in your Tree

Here’s how to add a Data Entry field to a node:
  1. Edit a question node from Overview or Designer.
  2. Under Data Collection Form Fields Click Add Form Field.2022-04-06_15-09-08.png
  3. A new Data Entry field dialog appears.  Select the type of data you want to collect, and enter a variable name and a label which the end-user will see.2022-04-06_15-15-31.png
  4. Select Required Field to make this field require an entry before proceeding.
  5. For radio buttons and list boxes, you can enter the option choices as well. If you are using scoring nodes, you can enter a score variable, and a score to assign to each choice.2022-04-06_15-20-20.png


Inserting Form Field Data into Other Parts of the Tree

Once the end-user adds data to a form field and then clicks a button, this data can appear anywhere in the tree’s content, question or title areas. The trick is to use the variable name, surrounded by # characters. For example, after adding a text input field named name,  insert text like this into a node to show the value of name:

Hello #name#! Welcome back.

The #name# part will be replaced with whatever was entered previously into the namefield.

Injecting Zingtree Form Data into Other Systems

Once your form fields are set up and your tree is running, the entered data can be injected into any other form.  Here’s how to do it:

  1. Make sure the variable names in your Zingtree form match the variable names on the form you want to inject data into.
  2. When opening the URL for the destination form, make sure to include &session_id=#session# in the link URL.
  3. In the destination form, include this piece of code:
    <script id="zingtree_field_id" value="session_data" src="//zingtree.com/api/zingtree.js">
    </script>

When the destination form is opened, it will include the data from the Zingtree session in the fields that match.

Misc Notes

  • Tech note: If you’re hand-coding the HTML for your forms, each form element must have a class of zt-data to be recognized and saved.

Was this article helpful?

0 out of 0 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