Address List
Present an address list to users in your WhatsApp chatbot with error handling, variable storage, and dynamic responses.
Overview
The Address List action allows the bot to present a list of addresses to users, who can select one as a response. The addresses can be dynamically retrieved from API calls or other actions and displayed in an interactive format.
Step-by-Step Instructions
Compose Your Message:
Enter a message to accompany the address list. The message has a maximum limit of 4096 characters.
Enhance the message with text formatting:
Bold: Enclose the desired text in double asterisks (
*).Italic: Enclose the text in underscores (
_).Strikethrough: Enclose the text in tildes (
~).
Add emojis by clicking the emoji icon to make the message more visually engaging.
Adding Variables:
To insert dynamic content, such as a customer’s name, click "Add Variables." The variable will automatically be replaced with the correct value when the message is sent.
Variables are divided into two categories:
Customer Fields: These pull in specific data for each customer (e.g.,
customer.name).Bot Variables: These pull in variables stored during the bot’s flow.
Variable for Address List:
Provide the variable name that holds the list of addresses. The list can be retrieved from an API call (refer to the API Call action) or another action that provides address data.
Variable Path (Optional):
If the address list is contained within a JSON structure, set the relative path to the array that holds the address list. This ensures the bot correctly extracts and presents the addresses.
Error Handling:
Error Attempt: Define the number of wrong input attempts allowed. Since users must select an address from the list, there’s a chance they might send something other than a valid selection (e.g., an image or unrelated text).
Error Message: Provide an error message to notify users when they submit an invalid response. Example: "Please select an address from the list provided."
Action on Invalid Input:
End the Flow: If the user exceeds the allowed number of invalid attempts, the flow will stop entirely, and the user will not continue.
Fall Back Flow: Trigger a different flow if the user fails to submit a valid response after several attempts.
Skip the Question: If the user submits invalid input, skip this question and proceed to the next action in the flow.
Store Response in a Variable (Optional):
Select a bot variable from the dropdown to store the user's address selection. This allows the bot to save the response and use it in future actions.
{
"selected_address": {
"name": "John Doe",
"address_line": "123 Main St, Apt 4B",
"city": "Springfield",
"state": "IL",
"postal_code": "62704"
}
}Example Use Case
Scenario: You want the user to select a delivery address from their saved addresses. The bot retrieves the address list from a previous action or an API call, presents the options, and stores the user’s selection for later use in the flow.
Message Example: "Please select your preferred delivery address from the list below."
FAQs
What happens if a user submits invalid input?
The bot will handle incorrect submissions based on the defined error attempts. You can choose to stop the flow, trigger a fallback, or skip the question.
Can I customize the error message for invalid input?
Yes, you can create a custom error message to guide users when they submit an invalid response.
Where does the address list come from?
The address list can be retrieved from an API call, another action in the bot flow, or stored data associated with the customer.
Troubleshooting Tips
Invalid Response: Make sure users understand they need to select from the provided list. If there are issues with invalid input, verify that the variable path for the address list is correctly set.
Address List Not Displaying: Ensure the variable holding the address list contains valid data and that the bot is retrieving the data correctly.
Last updated