I am building a flow in which I want to populate the WhatsApp list dynamically using API response. I went through the documentation and found a sample schema for quick replies but not for the Whatsapp List. So, How to achieve this?
Hey @DarshanPatel11,
We launched this feature last week only! You can use the following code snippet to dynamically populate WhatsApp List:
{
title: 'Please select your preferred slot for Appointment',
optionText: 'Appointment Slots',
options: [
{
section: 'June 5, 2021',
options: [
{ title: '9am-11am', text: '5.9-5', description: 'General Medicine' },
{ title: '12pm-2pm', text: '5.12-2', description: 'Orthopedic' },
{ title: '2pm-4pm', text: '5.2-4', description: 'Physiotherapy' },
]
},
{
section: 'June 6, 2021',
options: [
{ title: '9am-11am', text: '6.9-5', description: 'General Medicine' },
{ title: '12pm-2pm', text: '6.12-2', description: 'Orthopedic' },
{ title: '2pm-4pm', text: '6.2-4', description: 'Physiotherapy' },
]
}, {
section: 'June 7, 2021',
options: [
{ title: '9am-11am', text: '7.9-5', description: 'General Medicine' },
{ title: '12pm-2pm', text: '7.12-2', description: 'Orthopedic' },
{ title: '2pm-4pm', text: '7.2-4', description: 'Physiotherapy' },
]
}
],
footer: 'Please follow Covid Guideline while consulting.'
}
I tried the code snippet you gave, I am not getting any error in the logs, but Whatsapp List is not being sent to User via bot.
{“level”:“debug”,“log”:{“data”:“Executing Message Type [waList]”,“sender”:“918488862479”,“source”:“whatsapp”,“tag”:"",“traceId”:“918488862479_undefined”},“botId”:“x1632306469977”}
{“level”:“info”,“log”:{“data”:“Finished Executution for Async sources”,“sender”:“918488862479”,“source”:“whatsapp”,“tag”:"",“traceId”:“918488862479_undefined”},“botId”:“x1632306469977”}
No problem @DarshanPatel11 ! Can you please share your bot access with admin preveilage with me at pratik@yellow.ai?
@Pratik from { title: '9am-11am', text: '5.9-5', description: 'General Medicine' }
When user select the item from the list text
is the value to be stored in the variable right?
But that is not working, text
is not accessible.