Slot type from_text does not work

Hi all, I’m new in Rasa. The following scenario: The conversation with the user is ended with the question: "Did it help? If user answers no comes the question: “Should I save this?” User answers yes. Now the form should be opened and the user’s answer should be saved. There are three slots: demand , demand2, demand3. User will answer 3 questions and each time a slot should be filled. The slot should be filled with from_text if the intent: new_intent was found. I’m trying to implement slot mapping in a formAction. This is what the slotmapping function looks like:

class NachfrageForm(FormAction):
   def name(self) -> Text:
      return "nachfrage_user"
   
  def required_slots(tracker):
      return["demand", "demand2", "demand3"]
   
  def slot_mappings(self):
       return{
           "demand": self.from_text(intent="neuer_intent")]    
           "demand2": self.from_text(intent="neuer_intent")]     
          "demand3": self.from_text(intent="neuer_intent")]             
       }
       
   def submit(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[Dict]:
           dispatcher.utter_message("Thanks, your answers have been recorded!")
        return[]

Domain entries:

forms:
  nachfrage_user:
    nachfrage:
    - type: from_text
      intent: None
forms:
  nachfrage:
    demand:
    - type: from_text
      intent: None
    demand2:
    - type: from_text
      intent: None
   demand3:
    - type: from_text
      intent: None
slots:
  demand:
    type: text
    influence_conversation: true
demand2:
    type: text
    influence_conversation: true
demand3:
    type: text
    influence_conversation: true

Story:

- story: story_nicht_geholfen
  steps:
  - intent: deny
    entities:
    - nein: nein
  - action: utter_frage_lernhilfe_de
  - intent: affirm
    entities:
    - ja: ja
  - action: utter_ask_user
  - intent: neuer_intent
  - action: utter_ask_user2
  - intent: neuer_intent
  - action: utter_ask_user3
  - intent: neuer_intent
  - action: nachfrage_user
  - active_loop: nachfrage_user
  - active_loop: null
  - action: utter_menu_allgemein_de

Why are the slots not filled with the text in the appropriate “utter”?

Hello @inpemu

Your form is never executed in your story. It should contain the form action nachfrage and the active_loop, as described here.

Some other comments: What is the output of rasa --version for you? In Rasa 2.x you don’t need to write the form action. For your use case, I’d set influence_conversation: false for all demand slots. You don’t need yes/no entities; The intents affirm and deny should already carry the relevant information.

Thanks for replying . I will try it.