Button Payloads and Predicting Actions

I want to utter different action in my stories based on the payload value received by my button, but how do i set up that if condition in my story

For examples : I have 2 buttons yes or no, which ask user if they want to enter their details, if the user says yes i would like to utter an action which prompts user to enter details but if the user says not I want to end conversation, how can i use the payload values to drive the conversation in a specific direction

If someone could help, this would really help me out with my chatbot

thank you.

@Jivitesh, its simple, check:

on domain.yml:

utter_greet:
  - buttons:
    - payload: /affirm
      title: Yes!
    - payload: /deny
      title: No.
    text: Would you like to enter details?

on stories.yml:

- story: user enter details
  steps: 
  - intent: greet
  - action: utter_greet
  - intent: affirm
  - action: @Jivitesh, you continue from here


- story: user does not want to enter details
  steps: 
  - intent: greet
  - action: utter_greet
  - intent: deny
  - action: utter_bye

Retrain your model and test, hope it help you :smiley:

I will definitely try this, you’re the best, will inform ASAP is it works thanks so much

@marcos.allysson Thank you it works!

1 Like

@Jivitesh, nice :smiley: