Form Fields: Decision Trees with Data Entry

blog-howto-2

One of the most requested features for Zingtree interactive decision trees is to have the ability to collect key customer information from users while they are navigating your tree. So, we made it happen!

With Zingtree’s data entry feature, 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.

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

Example Tree

Try the Form Fields and Data Entry Demo tree from the gallery. This will ask you for some information, echo it in other parts of the tree, and finally inject it into a standard HTML form.

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. Click Add next to Data Entry Fields.

  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.

  4. Select Required 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.

  6. Click Add Field when finished.

 

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 name field.

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.

The Form Fields and Data Entry gallery tree shows a full example. Click all the way through, and you’ll see an HTML page with Zingtree forms data present.

Misc Notes

  • The form fields button in the editor is not available in Designer. You’ll need to use Overview, Edit Node to access it.
  • 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.

Any questions? Reach out to us at any time.

3 Comments

  • Nico says:

    I have a question if that’s ok?

    I’ve set up form fields in a question node. This works great!
    I’m also able to enter this data in another part of the tree, but not in an email form.

    What I’m looking for is when the tree is not able to answer a certain question, I would like to ask the customer additional information (via forms) and then put this in an email form.

    Is this possible? Am I doing something wrong?

    Thank you and best regards!

    Nico

    • Bill Zing says:

      This happens automatically. When you use data entry, and then submit an email using an email node, any form fields collected during the visitors use of the tree are sent along with the email.

      Talk to me using the orange chat bubble anywhere on zingtree.com if you have any more questions!

9 Trackbacks

Leave a Reply

Your email address will not be published. Required fields are marked *