How to submit forms with rasa-sdk 2.2.0?

Hi everyone,

I’m want to know how to submit a form after the filling.

If you remember, before, in rasa sdk-1.10.3, you should use submit method (in FormAction) that was executed directly after form filling.

Now with rasa-sdk 2.2.0, we must use FormValidationAction and I don’t uderstand how to submit form after the filling.

I tried in stories to execute a custom action after the form filling but bot don’t execute her.

Example of a story :

- story: test
  steps:
  - intent: how_to_do_something # -> user ask how to do something
  - action: utter_do_something # -> bot respond and explain how to do this thing
  - action: utter_ask_feeback # -> bot response is ok for user ?
  - intent: deny # -> Bot response was not ok for user because bot didn't respond correctly
  - action: report_conversation_form # -> form to send mail to administrator
  - active_loop: report_conversation_form
  - active_loop: null
  - action: action_submit_report_conversation_form # -> action to send mail but she's not executed

She’s the one and only story declared in stories.yaml file and she’s not executed correctly.

config.yml file :

language: fr
pipeline:
policies:
  - name: MemoizationPolicy
  - name: TEDPolicy
    max_history: 3
    epochs: 100
  # - name: MappingPolicy
  # - name: FormPolicy
  - name: RulePolicy

Activating/Deactivating a form is now handled by the RulePolicy. We’ve got a new guide which lists an example of a Rule that handles the form.

rules:
- rule: Submit form
  condition:
  # Condition that form is active.
  - active_loop: restaurant_form
  steps:
  # Form is deactivated
  - action: restaurant_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  # The actions we want to run when the form is submitted.
  - action: utter_submit
  - action: utter_slots_values

Are you using rules for forms at the moment or is there a reason why you’re trying to handle this via stories?

Hello @koaning,

I have more than 50 intents that need to use the form and in the rules documentation, it’s written “don’t overuse rules”.

It’s a feedback form, so I need to call him on every intent. Maybe there is a better way to achieve this.

To help me understand better, could you share what exactly you are asking for in your form? Also, what kind of assistant is this? Customer service? Anything you can share about the types of intents?

I have a similar issue, I’m struggling to submit forms. I want the user to confirm they are happy with the form contents before it is submitted, when I try to do this using rules, it tells me to use stories.