Ask Date
Collect and validate date-based information in WhatsApp chatbot flows using the Ask Date action.
Overview
The Ask Date action prompts users to enter a date during a WhatsApp chatbot interaction. This action is useful for collecting date-based information (e.g., booking dates, birth dates) and allows you to specify a date format, validate the response, and store it in a variable for later use.
Step-by-Step Instructions
Compose Your Message:
Enter your message in the text field (up to 4096 characters). This message will prompt the user to provide a date.
You can format the message to enhance clarity and engagement:
Bold: Select the text and click the "B" button to enclose it in double asterisks (
*).Italic: Highlight the text and click the "I" button to enclose it in underscores (
_).Strikethrough: Select the text and click the "s" button to enclose it in tildes (
~).
Add emojis by clicking on the emoji icon to make the message more engaging.
Adding Variables:
Click on the "Add Variables" button to insert dynamic content (such as the user’s name or order details). Choose the appropriate variable from the dropdown list. Tip: Ensure the variable selected contains valid data, or the message may display incorrectly.
Date Format (Optional):
Define the date format you expect the user to enter. This helps standardize the input and ensures consistency. Example formats include:
DD/MM/YYYY
MM/DD/YYYY
YYYY-MM-DD
Inform users of the expected date format in the message to prevent confusion and errors.
Error Handling:
Error Attempt: This setting defines how many incorrect attempts the user can make when responding with an invalid date or any other input (e.g., an image or text).
Error Message: Provide a clear message when the user enters an invalid date. For example, "Please enter a valid date in the format DD/MM/YYYY."
Action on Invalid Input:
End the Flow: If the user exceeds the maximum allowed error attempts, the chatbot will stop the current flow.
Fall Back Flow: Redirect the user to another action by triggering a different flow when the error limit is reached.
Skip the Question: If the user consistently provides invalid responses, the bot can bypass this question and continue to the next step in the flow.
Validation Settings (Optional):
Start Date: Ensure the date entered by the user is after a specific start date. If they enter a date before this, it will be marked as an error, and the error-handling procedure will begin.
End Date: Prevent users from entering a date after a specific end date. Any date beyond this point will be considered invalid.
Store Response in a Variable (Optional):
Store the user’s date response by selecting a bot variable from the dropdown. This allows the date to be referenced later in the conversation or for follow-up purposes. Example: Store the response in a variable like
user_dateand access it using{variable.user_date}.
Examples
Date of Birth Collection: "Please provide your date of birth (DD/MM/YYYY)."
Event Booking: "Select a date for your appointment (MM/DD/YYYY)."
FAQs
Can users input dates in any format?
No, users must enter the date in the specified format, such as DD/MM/YYYY. You can configure the format and validate the input accordingly.
What happens if the user enters a date outside the allowed range?
The chatbot will treat the input as invalid, send an error message, and follow the configured error-handling procedure.
Troubleshooting Tips
Date Format Mismatch: If users are entering dates in the wrong format, make sure your message specifies the expected format.
Invalid Date Range: Ensure that the start and end dates for validation are correctly set to avoid rejecting valid inputs
Last updated