Error in setting button responses through payloads

Why am I facing this issue with the button responses to capture user response?

utter_age:
  - text: "What is your age?"
  - buttons:
    - title: "Above 18" 
      payload: '/age{{"age":"Above 18 years"}}'
    - title: "Below 18"
      payload: '/age{{"age":"Above 18 years"}}'ste code here
stories:

- story: Above18_male_severe
  steps:
  - intent: greet
  - action: utter_problem
  - intent: fever
  - action: utter_age
  - intent: age
  - slot_was_set:
    - age: Above 18 years
in E:\A:
      <SchemaError: error code 2: Missing 'text' or 'custom' key in response or null 'text' value in response.: Path: '/'>. Path: /responses/utter_age

Looking forward to your response.

should be

utter_age:
  - text: "What is your age?"
    buttons:
    - title: "Above 18" 
      payload: '/age{{"age":"Above 18 years"}}'
    - title: "Below 18"
      payload: '/age{{"age":"Above 18 years"}}'ste code here

text and buttons should be in the same group, otherwise, they’d be counted as two different responses, and this is why the error says you’re missing the text key - because you can’t define a response with buttons only.

Thank you for the response.

1 Like