Introduction:
This guide shows how to create custom fields for capturing and displaying date and time in LeadsHook. We will cover how to set up date, time, and datetime fields and how to capture and display these fields using nodes and the text editor.
1. First create custom fields
To create a custom Date field:
- Create a new custom field
- Give it a variable name (eg. date)
- Give it a label (eg. Date)
- Select date as the type
- Enable the visibility
For example:
To create a custom Time field:
- Create a new custom field
- Give it a variable name (eg. time)
- Give it a label (eg. Time)
- Select time as the type
- Enable the visibility
For example:
To create a custom Datetime field:
- Create a new custom field
- Give it a variable name (eg. datetime)
- Give it a label (eg. Date & Time)
- Select datetime as the type
- Enable the visibility
2. To capture and display node level Date/Time/Datetime
3. To capture and display Date/Time/Datetime fields using the text editor.
For the date chooser. In a question’s text editor paste this:
<p style="text-align: center;">Select a Date </p>
<p style="text-align: center;"><input name="date" type="date" /></p>
To display this variable just type the variable name into a question’s text editor. For example:
{date}
For the time chooser. In a question’s text editor paste this:
<p style="text-align: center;">Select a Time </p>
<p style="text-align: center;"><input name="time" type="time" /></p>
To display this variable just type the variable name into a question’s text editor. For example:
{time}
For the Datetime chooser. In a question’s text editor paste this:
<p style="text-align: center;">Select a Date & Time </p>
<p style="text-align: center;"><input name="datetime" type="datetime-local" /></p>
To display this variable just type the variable name into a question’s text editor. For example:
{datetime}
4. To capture and display Date/Time/Datetime fields using the Chatbot.
Pro Tips:
- Make sure to test the functionality of your custom fields after creation.
- Ensure the fields’ visibility is enabled for them to function correctly.
Troubleshooting:
- If the fields aren’t working as expected, double-check the input type and the custom field’s visibility.
Conclusion:
By following these steps, you can capture and display date and time data in your decision trees. This adds a dynamic element to your decision trees, allowing you to use real-time data to personalize your nodes further.