How to handle entity values in slots in rasa 3.x form?

What is the scenario ?

I am using rasa to fill up a newsletter form which has 2 slots, namely : email of user and frequency of newsletter.

What is the problem in implementing the scenario ?

When the form is activated, only 1 slot (email) is read properly, the other slot (frequency) is not read during the active loop.

Please find details below: domain.yml:

intents:

  • affirm
  • bot_challenge
  • inform_email
  • inform_frequency
  • subscribe_newsletter entities:
  • age
  • name
  • state
  • email
  • frequency slots: email: type: text influence_conversation: true mappings:
    • type: from_entity entity: email intent: inform_email conditions:
      • active_loop: bk_news_letter_form frequency: type: text influence_conversation: true mappings:
    • type: from_entity entity: frequency intent: inform_frequency conditions:
      • active_loop: bk_news_letter_form forms: bk_news_letter_form: required_slots:
      • email
      • frequency responses: utter_ask_email:
    • text: What is you email address ? utter_ask_frequency:
    • text: How often do you want to receive emails from me ? actions:
  • action_newsletter_subscription

rules.yml:

  • rule: activate newsletter form steps:

    • intent: subscribe_newsletter
    • action : bk_news_letter_form
    • active_loop: bk_news_letter_form
    • slot_was_set:
      • requested_slot: email
    • slot_was_set:
      • requested_slot: frequency
  • rule: submit form condition:

    • active_loop: bk_news_letter_form steps:
    • action: bk_news_letter_form
    • active_loop: null
    • slot_was_set:
      • requested_slot: null
    • action: action_newsletter_subscription

nlu.yml:

running rasa to use forms:

2022-11-23 18:56:29 INFO root - Starting Rasa server on http://0.0.0.0:5005 2022-11-23 18:56:31 INFO rasa.core.processor - Loading model models/20221123-171919-clear-emporium.tar.gz… 2022-11-23 18:56:53 INFO root - Rasa server is up and running. Bot loaded. Type a message and press enter (use ‘/stop’ to exit): Your input → I want to get the newsletter
What is you email address ? Your input → my email is test1@gmail.com
Your input → -----> this is coming blank
Your input →

rasa details: Rasa Version : 3.3.1 Minimum Compatible Version: 3.0.0 Rasa SDK Version : 3.3.0 Python Version : 3.7.15 Operating System : Darwin-21.6.0-x86_64-i386-64bit

note: now this is the issue, when form is active it only reads 1 slot (email) and not frequency. Expecting : Your input → How often do you want to receive emails from me ?

How can I get the other slot (frequency) working…?

Hi @bsingh, this part would be more appropriate for stories.

You can check how the “frequency” slot is being filled using rasa interactive

Thanks @rasa_learner , as per your suggestion I moved below to stories:

stoies.yml

  • story: subscribe to newsletter steps:
    • intent: subscribe_newsletter
    • action: bk_news_letter_form
    • active_loop: bk_news_letter_form
    • slot_was_set:
      • requested_slot: email
    • slot_was_set:
      • requested_slot: frequency
    • active_loop: null
    • action: action_newsletter_subscription

and re-tried, still the slot : frequency did not loaded. I made below change in the domain.yml from a blog:

domain.yml

######## slots from entity – 2 the working one !!! !!! slots: email: type: text mappings: - type: from_entity entity: email frequency: type: text mappings: - type: from_entity entity: frequency

After that it started working. Thanks for quick response and help here.