Using a Timestamp Variable in your Decision Tree

Some of our customers have asked for a way to display the current time/date/day of the week in a node, set the time zone, and custom format it. There’s a predefined Zingtree Webhook to do just that!

This webhook sets a variable named #timestamp# which you can use in any part of your decision tree, format it in a variety of ways, and even perform logic operations on it. Click through below to see our demo of how it all works…

 

Example uses:

  • Display the day of the week.
  • Use a Logic Node to route customers to different nodes for work hours, after hours or weekends.
  • Show the current date and time, display it in a node, and save it as a part of your session.

How to Set Up Timestamps

  1. Edit a node, and open the Show Advanced Options link.
  2. Under “Send Message to App”, select Webhook: Zingtree Timestamp.

  3. You can also include an optional timezone or a date format as parameters to sent to the webhook. (More details below). It looks like this:

  4. In the content area for your node, the timestamp will appear wherever you enter #timestamp#.
  5. Click Save Changes when you are done.

See the “Timestamp Webhook Demo” tree from the Zingtree Gallery.

Customizing

In the Message area, you can include two parameters:

  • &tz= to set a time zone.
  • &format= to set a custom date format.

Example message area customizations:

&tz=America/New_York&format=F j,Y h:i:s A
This sets the time zone to Eastern Time (USA), and makes the timestamp variable look like ” July 25, 2017, 11:37:27 AM“.

&tz=Australia/Sydney&format=d/m/Y
This sets the timezone to Sydney, Australia, and makes the date appear as “25/07/2017”.

&format=l
This sets the #timestamp# variable to the day of the week.

See the “Timestamp Webhook Demo” Gallery tree for other examples.

Reference

The full list of timezones is here.

The full list of date formatting options is here.

Leave a Reply

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