Set Slot with button in Rasa 2.x

Hey

I want to set a slot by using a button. For some reason, the slot never be filled. I’m using RASA 2.5.

domain.yml:

slots:
  datenschutzhinweis:
    type: text

  utter_askIfCustomerHappy:
  - text: "Are you happy with the product?"
    buttons:
    - title: "Yes, happy"
      payload: '/affirm{"customer_satisfaction":"yes"}'      
    - title: "No, unhappy"
      payload: '/denny{"customer_satisfaction":"no"}'

  utter_satisfaction:
    - text: "Thanks for your answer. You are {customer_satisfaction}!"

stories.yml

stories:

- story: happy path
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_askIfCustomerHappy
  - intent: affirm
  - action: utter_satisfaction

If I go the happy path, the response is: *Thanks for your answer. You are None!*

What am I doing wrong?

Hi @Chatbot_Ra ,

At first look, I can see slot customer_satisfaction is missing from domain.yml under slots key. I would recommend adding it and then testing on the command line using rasa shell --debug. If you still run into issues, could you please post the full debug log here?

I would also recommend adding responses key if that’s missing from your domain.yml. So everything would look like this:

slots:
  datenschutzhinweis:
       type: text
  customer_satisfaction:
       type: text

responses:
  utter_askIfCustomerHappy:
....
1 Like

Thank you very much. You spotted it right. However, this was just a simple mistake, when converting my problem into a rasa question. The solution was, that I have to define the steps in the rule-file. Otherwise the slot value is not saved properly. I find it rather confusing to distiguish between rules and stories. I have to get used to it. Did’t know that it can have this impact on slots