# Facebook Generic Template/Card Carousel

**URL:** <https://forum.rasa.com/t/facebook-generic-template-card-carousel/40337>\
**Category:** Tutorials, Resources & Videos\
**Created:** [February 18, 2021, 10:24am UTC](https://forum.rasa.com/t/facebook-generic-template-card-carousel/40337 "2021-02-18T10:24:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IsraaMohamedHamid](https://avatars.discourse-cdn.com/v4/letter/i/a9a28c/32.png) [@IsraaMohamedHamid](https://forum.rasa.com/u/IsraaMohamedHamid)\
**Post date:** [February 18, 2021, 10:24am UTC](https://forum.rasa.com/t/facebook-generic-template-card-carousel/40337/1 "2021-02-18T10:24:22Z")

</div>

This card carousel code is working, however when I press the button “See Menu” I would like the code to store the restaurant name in the slot. So far that has not worked.

I get this error:

> UserWarning: Failed to parse arguments in line ‘/ask\_chosen\_restaurant\_name\_en{“chosen\_restaurant\_name\_en”:restaurant\_details\_en[0]}’. Failed to decode parameters as a json object. Make sure the intent is followed by a proper json object. Error: Expecting value: line 1 column 30 (char 29) More info at [Stories](https://rasa.com/docs/rasa/stories)

This is the code please let me know what the error is, I have been trying for the past week and still no result.

Action file:

> ```
> gt = {
> "attachment": {
> "type": "template",
> "payload": {
> "template_type": "generic",
> "elements": [
> ]
> }
> }
> }
>   
> 
>   
> for restaurant_details_en in all_restaurant_details_en:
> dict_card = {}
> dict_card['title'] = restaurant_details_en[0] ##restaurant name
> dict_card['image_url'] = restaurant_details_en[1] ##restaurant image
> dict_card['subtitle'] = city_loc_en + ", "+ restaurant_details_en[3] + ", "+ restaurant_details_en[4] + "\nRating: " + restaurant_details_en[8] ## First part shows the entire address and second part shows the rating
> dict_card['default_action'] = {}
> dict_card['default_action']['type'] = 'web_url'
> dict_card['default_action']['url'] = restaurant_details_en[11] ## restaurant facebook URL
> dict_card['default_action']['webview_height_ratio'] = 'tall'
> dict_card['buttons'] = []
> dict_card['buttons'].append({})
> dict_card['buttons'][0]['type'] = 'postback'
> dict_card['buttons'][0]['payload'] = '/ask_chosen_restaurant_name_en{"chosen_restaurant_name_en":restaurant_details_en[0]}' ## WHEN BUTTON IS PRESSED STORE RESTAURANT NAME TO SLOT
> dict_card['buttons'][0]['title'] = 'See menu'   
> dict_card['buttons'].append({})
> dict_card['buttons'][1]['type'] = 'web_url'
> dict_card['buttons'][1]['url'] = restaurant_details_en[11] ## Restaurant location using google maps 
> dict_card['buttons'][1]['title'] = 'Open Location'   
> gt['attachment']['payload']['elements'].append(dict_card)
> 
> ```

NLU File:

- intent: ask\_chosen\_restaurant\_name\_en examples: |
  - # Extra Food
  - Azal Al-yemen Tourist Restaurant
  - Bab Al-yemen Restaurant
  - Chill ‘N’ Grill
  - Delice
  - Dice
  - Mandos
  - Mavo
  - Ministry of Food
  - Mr. Shawarma
  - Smokey Burger
  - Syrian Fresh Foods

The line in the action file that does not produce an output is:

> ```
> dict_card['buttons'][0]['payload'] = '/ask_chosen_restaurant_name_en{"chosen_restaurant_name_en":restaurant_details_en[0]}' ## WHEN BUTTON IS PRESSED STORE RESTAURANT NAME TO SLOT
> 
> ```

Please help me out I am pressed for time!!

---

<div class="post-metadata">

**Author:** ![IsraaMohamedHamid](https://avatars.discourse-cdn.com/v4/letter/i/a9a28c/32.png) [@IsraaMohamedHamid](https://forum.rasa.com/u/IsraaMohamedHamid)\
**Post date:** [February 19, 2021, 7:31pm UTC](https://forum.rasa.com/t/facebook-generic-template-card-carousel/40337/2 "2021-02-19T19:31:31Z")

</div>

It worked turns out the issue was with my story. If anyone has a similar problem feel free to ask me.
