Deal with multiple identical buttons in form

Hello

I have a story where i use the formfilling to ask the user multiple questions with the same possible answers. For example:

Q1: Are you in highschool? → A1: Yes/No/Maybe

Q2: Do you like your current occupation? → A2: Yes/No/Maybe

Q3: and so on…

Is there a way to define these buttons just once or do i need to write the buttons into every utter_ask_x?

Edit: similar issue in slots: Do i really need for every slot

highschool: type: categorical auto_fill: false
values: - yes - no - maybe

You will need to define the buttons into every utter_ask_x. However, you don’t need to have slots for these answers, you can have a different intent for each answer and handle this in your stories. However, then you will have more stories, so it depends if you’d rather have more stories, or more slots.

Hello, I am working on a project and I want to do the same but I am stuck; I want to ask multiple questions with the same answers using slots because I want to save the answers. the dialogue should be as follows:
- i am ill
do you itch?y/n
- y
do you have a skin rash?
- y
also, here are some parts of my code: in domail.yml

slots:

  itching:

    type: unfeaturized

  skin_rash:

    type: unfeaturized

responses:

  utter_ask_itching:

    - text: do you itch?y/n

  utter_ask_skin_rash:

    - text: do you have skin rash?y/n
forms:

- form_info
in nlu.md
`## intent:imply_disease`

    - my baby is sick

    - I want to know if my baby is ill

    - I want to test against [allergy](disease)

    - I have some [symptoms](symptom) of a disease 

    - I [itch](symptom) too much

    - I am having [itching](symptom)

    - Yes, I have [itching](symptom)

    - I have continuous [sneezing](symptom)

    - I think I have [common cold](disease), I want to make sure

## intent: inform

- [yes](affirm)

- [y](affirm)

- [no](deny)

- [n](deny)

in stroies.md

## predict disease happy path

*greet 

  - utter_greet

*imply_disease{"disease":"allergy", "symptom":"sneezing"}

  - form_info

  - form{"name": "form_info"}

  - form{"name": null}

*thank

  - utter_goodbye

I was studying Sara assistant tutorial in docs in the part of slots and I was doing the same but I guess the problem is in the intent inform has the same samples(yes and no) so I don't know what to do, I am new to rasa hope you can help, please! @erohmensing @michaelh

@nadamakram instead of using inform for yes and no, you should have separate intents – then you can use the from_intent slot mapping to assign values based on yes and no.

1 Like