# Custom Rasa/webchat and facebook messenger carousel

**URL:** <https://forum.rasa.com/t/custom-rasa-webchat-and-facebook-messenger-carousel/32127>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [August 2, 2020, 6:48pm UTC](https://forum.rasa.com/t/custom-rasa-webchat-and-facebook-messenger-carousel/32127 "2020-08-02T18:48:26Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![bharath-madduri](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/bharath-madduri/32/18010_2.png) [@bharath-madduri](https://forum.rasa.com/u/bharath-madduri)\
**Post date:** [May 4, 2022, 10:46am UTC](https://forum.rasa.com/t/custom-rasa-webchat-and-facebook-messenger-carousel/32127/10 "2022-05-04T10:46:17Z")

</div>

I can tell you for one button on rasa webchat , you can extend the same to fb. Here the `data` is your json/dict which has the information related to your carousels(fetched from database). you can optimize the below code.

```auto
carousel_list = []
for i in range(len(data)):
   empty_dict = {}        
   buttons = [{"title": "Title","url": "", "type": "web_url"}]
   empty_dict['title'] = data[i]['Title']
   empty_dict['subtitle'] = data[i]['Subtitle']  
   empty_dict['image_url'] = data[i]['image_url']
   empty_dict['buttons'] = buttons
   empty_dict['buttons'][0]['url'] = data[i]['image_url']
   carousel_list.append(empty_dict)

```

```auto
test_carousel = { "type": "template",
                          "payload": {
                          "template_type": "generic",
                          "elements": carousel_list                       
                              }     
                          }

```

---

_[View the full topic](https://forum.rasa.com/t/custom-rasa-webchat-and-facebook-messenger-carousel/32127)._
