Dynamic lists in WhatChimp help you create engaging WhatsApp messages by automatically generating rows using data like product details or appointment dates. Instead of manually creating each row, you can pull the information directly from your API response.
This guide will show you how to set up dynamic lists, with a product catalog example.
Table of Contents #
- What Are Dynamic Lists?
- Example Use Case
- Step-by-Step Guide
- JSON Configuration Examples
- Handling Nested JSON
- Best Practices
What Are Dynamic Lists? #
Dynamic lists are rows in WhatsApp messages that are created automatically using data from a custom field. You define the keys (like product names or prices), and the rows are filled with values from the API response.
Key Points #
- A dynamic list pulls data from a JSON object in a custom field.
- Each row is populated with information like product names, prices, or descriptions.
- You can use an API call to fetch data and store it in a custom field.
Interactive/ Dynamic Lists Limitations #
- WhatsApp limits each interactive list message to 10 rows.
- If you need more rows, send multiple messages (one for the first 10, then additional ones as needed).
Example Use Case #
Imagine you want to send a product catalog to a user. Here’s a sample API response:
[
{
“product_name”: “Apple iPhone 15 Pro”,
“price”: “$999”,
“description”: “A17 Pro chip, 48MP camera”,
“buy_link”: “https://www.apple.com/iphone-15-pro/”
},
{
“product_name”: “Samsung Galaxy S24 Ultra”,
“price”: “$1,199”,
“description”: “6.8-inch AMOLED display, 200MP camera”,
“buy_link”: “https://www.samsung.com/galaxy-s24-ultra/”
}
]
Each product will be turned into a dynamic row in WhatsApp with its title, description, and link.
Step-by-Step Guide #
1. Fetch Data Using HTTP API #
- Go to HTTP API Integration in WhatChimp.
- Set up the API to fetch your data (e.g., product catalog).
- Assign the API response to a custom field (e.g., ProductCatalog). It should be in a JSON array format like the sample API response above
2. Configure Dynamic Rows in the Flow Builder #
- Row Generation Method: Set to Dynamic to enable rows based on the custom field data.
- Custom Field for Dynamic Rows: Select the custom field containing the JSON data (e.g., ProductCatalog).
- Key for Dynamic Row Title: Choose the key from your JSON data (e.g., product_name to dynamically display values like “Apple iPhone 15 Pro” or “Samsung Galaxy S24 Ultra”).
- Row Description: Use a format like #custom_field ->key#
For example: #ProductCatalog->price# – #ProductCatalog->description# to show price and description like below.
($999 – The Apple iPhone 15 Pro features a powerful A17 Pro chip, 48MP camera system, and a sleek titanium design for maximum performance and durability.) - Save Selection: Choose a custom field to store the user’s selection (e.g., SelectedProduct), and set the key to buy_link to save the product’s purchase link.
(e.g., https://www.apple.com/iphone-15-pro/).
3. Test Your Dynamic List #
- Preview the message to ensure rows are generated based on the API data.
- Interact with the message as a user and verify that the selection is saved correctly.
JSON Configuration Examples #
Example 1: Product Catalog #
JSON Example
[
{
“product_name”: “Apple iPhone 15 Pro”,
“price”: “$999”,
“description”: “Powerful A17 Pro chip, 48MP camera.”,
“buy_link”: “https://www.apple.com/iphone-15-pro/”
},
{
“product_name”: “Samsung Galaxy S24 Ultra”,
“price”: “$1,199”,
“description”: “6.8-inch AMOLED display, 200MP camera.”,
“buy_link”: “https://www.samsung.com/galaxy-s24-ultra/”
}
]
Dynamic Configuration
- Row Title (Key): product_name
- Row Description: #ProductCatalog->price# – #ProductCatalog->description#
- Saved Value (Key): buy_link
Example 2: Appointment Dates #
{
“0”: “07-01-2025”,
“1”: “08-01-2025”,
“2”: “09-01-2025”
}
Dynamic ConfigurationSet Dynamic Rows:
- Choose Dynamic to automatically create rows from the JSON data.
- Link the Custom Field:
- Set Custom Field for Dynamic Rows to #AppointmentDateList# (where your dates are stored).
- Row Title:
- Leave it blank—the system will automatically use the keys (“0”, “1”, etc.) for row titles.
- Save User’s Selection:
- Map the selected date to a custom field (e.g., AppointmentDate#).
- Key/Index for Saved Value: Keep it BLANK to save the chosen value in the custom field.
You have a list of dates stored in JSON format and want to show them as dynamic options in WhatsApp. The system automatically generates rows for each date.
Handling Nested JSON (If the Dates Are Inside an Object) : #
{
“success”: true,
“available_dates”: {
“0”: “07-01-2025”,
“1”: “08-01-2025”
}
}
- Set Custom Field for Dynamic Rows to #AppointmentDateList#.
- Use “available_dates” for the Row Title.
- Leave Row Description Format BLANK or use the static.
- Map the selected value to #AppointmentDate#.
This configuration will fetch dates dynamically from the available_dates key.
Best Practices #
- Well-Formatted API Responses: Ensure your API response is in a correct JSON array format.
- Clear and Intuitive Keys: Use easy-to-understand keys for better data organization.
- Test Before Sending: Always test your dynamic list before going live.
Dynamic lists in WhatChimp help you send personalized and interactive WhatsApp messages by pulling data directly from your API. Start using dynamic lists to improve user engagement and create tailored experiences for your customers!