How to generate Whatsapp List dynamically

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?

1 Like

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”}

1 Like

No problem @DarshanPatel11 ! Can you please share your bot access with admin preveilage with me at pratik@yellow.ai?