# Adding buttons in YAML file

**URL:** <https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308>\
**Category:** Rasa Open Source\
**Created:** [September 24, 2020, 12:01pm UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308 "2020-09-24T12:01:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arunshowri](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arunshowri/32/11224_2.png) [@Arunshowri](https://forum.rasa.com/u/Arunshowri)\
**Post date:** [September 24, 2020, 12:01pm UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/1 "2020-09-24T12:01:51Z")

</div>

When am adding buttons in doamin.yml file we create with pattern

```auto
buttons:
- title: "Happy"
  payload: "utter_happy"
- title: "Sad"
  payload: "utter_cheer_up"

```

but when i train and open it using rasa x this pattern got reversed and the buttons are not working properly.

it changed to this pattern

````auto
- buttons:
  - payload: /National
    title: National
  - payload: /International
    title: International
   ```

it would be highly helpful if anybody respond on this topic!!
````

---

<div class="post-metadata">

**Author:** ![jusce17](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jusce17/32/10023_2.png) [@jusce17](https://forum.rasa.com/u/jusce17)\
**Post date:** [September 24, 2020, 12:36pm UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/2 "2020-09-24T12:36:35Z")

</div>

Hi @Arunshowri, welcome to the community, can you share the whole code here, in the meantime I think you should right something like this:

```
utter_name_of_utter:
  - buttons:
    - payload: utter_happy
      title: Happy
    - payload: utter_cheer_up
      title: Sad
    text: some display message here
```

---

<div class="post-metadata">

**Author:** ![jusce17](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jusce17/32/10023_2.png) [@jusce17](https://forum.rasa.com/u/jusce17)\
**Post date:** [September 24, 2020, 12:39pm UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/3 "2020-09-24T12:39:15Z")

</div>

Also, I believe in the payload you should pass the intent that will trigger the utter, like:

If you have an intent : feeling\_sad and an utter: utter\_cheer\_up perhaps it would something like this:

```
utter_mood:
  - buttons:
    - payload: /feeling_happy
      title: Happy
    - payload: /feeling_sad
      title: Sad
    text: How are you feeling today ?

```

Hope it helps

---

<div class="post-metadata">

**Author:** ![Arunshowri](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arunshowri/32/11224_2.png) [@Arunshowri](https://forum.rasa.com/u/Arunshowri)\
**Post date:** [September 24, 2020, 3:07pm UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/4 "2020-09-24T15:07:12Z")

</div>

This is the code before training :

session\_config: session\_expiration\_time: 60 carry\_over\_slots\_to\_new\_session: true intents:

- greet
- goodbye
- affirm
- deny
- mood\_great
- mood\_unhappy
- bot\_challenge
- news\_search
- national\_news
- international\_news responses: utter\_greet:
  - text: Hey! How are you? utter\_news\_search:
  - text: What would you prefer buttons:
    - title: National payload: /National
    - title: International payload: /International utter\_national\_news:

  - text: ‘Here is your national news: [India Today](https://www.indiatoday.in/)’ utter\_international\_news:
  - text: ‘Here is your International news: [India Today](https://www.indiatoday.in/world)’ utter\_cheer\_up:
  - image: [https://i.imgur.com/nGF1K8f.jpg](https://i.imgur.com/nGF1K8f.jpg) text: ‘Here is something to cheer you up:’ utter\_did\_that\_help:
  - text: Did that help you? utter\_happy:
  - text: Great, carry on! utter\_goodbye:
  - text: Bye utter\_iamabot:
  - text: I am a bot, powered by Rasa.

* * *

here is the code after training:

session\_config: session\_expiration\_time: 60 carry\_over\_slots\_to\_new\_session: true intents:

- greet
- goodbye
- affirm
- deny
- mood\_great
- mood\_unhappy
- bot\_challenge
- news\_search
- national\_news
- international\_news responses: utter\_greet:
  - text: Hey! How are you? utter\_news\_search:
  - buttons:
    - payload: /National title: National
    - payload: /International title: International text: What would you prefer utter\_national\_news:

  - text: ‘Here is your national news: [India Today](https://www.indiatoday.in/)’ utter\_international\_news:
  - text: ‘Here is your International news: [India Today](https://www.indiatoday.in/world)’ utter\_cheer\_up:
  - image: [https://i.imgur.com/nGF1K8f.jpg](https://i.imgur.com/nGF1K8f.jpg) text: ‘Here is something to cheer you up:’ utter\_did\_that\_help:
  - text: Did that help you? utter\_happy:
  - text: Great, carry on! utter\_goodbye:
  - text: Bye utter\_iamabot:

---

<div class="post-metadata">

**Author:** ![jusce17](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jusce17/32/10023_2.png) [@jusce17](https://forum.rasa.com/u/jusce17)\
**Post date:** [September 24, 2020, 9:51pm UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/5 "2020-09-24T21:51:00Z")

</div>

Can you format your code (put it inside of `` ) or a send a screenshot please

---

<div class="post-metadata">

**Author:** ![Arunshowri](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arunshowri/32/11224_2.png) [@Arunshowri](https://forum.rasa.com/u/Arunshowri)\
**Post date:** [September 28, 2020, 8:33am UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/6 "2020-09-28T08:33:33Z")

</div>

hey eden ,

i’ve sent you the screenshots please check them and respond asap.

---

<div class="post-metadata">

**Author:** ![jusce17](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jusce17/32/10023_2.png) [@jusce17](https://forum.rasa.com/u/jusce17)\
**Post date:** [September 28, 2020, 9:10am UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/7 "2020-09-28T09:10:50Z")

</div>

Hey @Arunshowri, where did you send them ?

---

<div class="post-metadata">

**Author:** ![Arunshowri](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arunshowri/32/11224_2.png) [@Arunshowri](https://forum.rasa.com/u/Arunshowri)\
**Post date:** [September 28, 2020, 9:27am UTC](https://forum.rasa.com/t/adding-buttons-in-yaml-file/34308/8 "2020-09-28T09:27:29Z")

</div>

check your email please!!
