Form gets stuck on Yes/No questions

I’m trying to build a contextual chatbot similar to the one linked here: https://blog.rasa.com/building-contextual-assistants-with-rasa-formaction/?_ga=2.79197780.1793384467.1592808345-202682246.1592210056

It uses forms and slot-filling, and has multiple yes-or-no questions. However, it keeps repeating the yes-or-no questions and doesn’t move forward. All the other questions work fine.

For reference, here is my code.

‘’'def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:

    return {
        "degreeyn": [  
            self.from_intent(intent="affirm", value="yes"),
            self.from_intent(intent="deny", value="no")],
        "degreestatus": [  
            self.from_intent(intent="affirm", value="yes"),
            self.from_intent(intent="deny", value="no")],
        "fieldyn": [  
            self.from_entity(entity="fieldyn"),
            self.from_intent(intent="affirm", value="yes"),
            self.from_intent(intent="deny", value="no")],
        "highschoolyn": [  
            self.from_entity(entity="highschoolyn"),
            self.from_intent(intent="affirm", value="yes"),
            self.from_intent(intent="deny", value="no")]
        }'''

From the domain.yml file:

‘’’ intents:

  • greet
  • bye
  • thank
  • recruit_ask
  • inform
  • chitchat
  • affirm
  • deny

entities:

  • name
  • contactnumber
  • emailaddress
  • location
  • degreeyn
  • degreestatus
  • degreeyear
  • degreeGPA
  • fieldyn
  • field
  • highschoolyn
  • gradelevel
  • percent ‘’’

‘’’

happy path

  • recruit_ask
    • utter_recruit
    • recruit_form
    • form{“name”: “recruit_form”}
    • form{“name”: null}
    • utter_thank
    • action_restart ‘’’

I figured this out, so I’m sharing the solution in case it helps anyone.

My bot was getting stuck because I hadn’t included all the other slots in the ‘’‘slot_mapping’’’ function. I just assumed that I needed to specify the special cases, but once I added the other slots it worked just fine.