Using custom actions with inside a form

Hello RASA community, I have a problem where I the user to input two slots into a form. In the first slot called “vaccine”, the user is asked to choose from a list of vaccines using buttons. Next, the user should get information about his or her selected vaccine, followed by the second slot which is called “satisfaction”, where the system asks the user if he is satisfied with the answer he/she got. However, RASA tries to fill the slots first, giving me no room in stories.yml to execute an action in between these two slot fillings. utter_ask_<slot_name> also only has the option to specify text/buttons with payload and slots, but no way to specify an action that I want to execute in between. The relevant parts of domain and rules are as follows

 utter_ask_vaccine:
  • buttons:
    • payload: /choose_vaccine{{“vaccine”:“az_vaccine”}} title: Astra Zeneca
    • payload: /choose_vaccine{{“vaccine”:“moderna_vaccine”}} title: Moderna
    • payload: /choose_vaccine{{“vaccine”:“biontech_vaccine”}} title: Biontech
    • payload: /choose_vaccine{{“vaccine”:“sinopharm_vaccine?”}} title: Sinopharm text: Which vaccine are you interested in? utter_satisfication_end:
    • text: Thank you for using the COVID chatbot. utter_ask_satisfaction:
    • buttons:
      • payload: /give_satisfaction{{“satisfaction”:“positive”}} title: Yes
      • payload: /give_satisfaction{{“satisfaction”:“negative”}} title: No text: Is this what you wanted?

rules.yml

  • rule: Activate form steps:

    • intent: access_summary_vaccine
    • action: check_if_happy_form
    • active_loop: check_if_happy_form
  • rule: Get satisfication condition:

    Condition that form is active.

    • active_loop: check_if_happy_form steps:

    Form is deactivated

    • action: check_if_happy_form
    • active_loop: null
    • slot_was_set:
      • requested_slot: null

    The actions we want to run when the form is submitted.

    • action: action_access_summary_vaccine
    • action: utter_satisfication_end

Can anyone help me here? Thank you!

@KvenS what’s is your error?

Hey NiK! Sorry for the late reply. There is no error as is, I only want to know how the syntax for activating actions inside a form works. I know that you can choose actions to be executed after the form is filled, but I want an action in-between filling slots. Is there a way? Thanks for your reply!

@KvenS Its ok no need to sorry. As per the action that can be of two types now based on your stories or rules one is action which is used for the syntax action and other one is custom action mention in action itself ok:

rules:
- rule: Say `hello` whenever the user sends a message with intent `greet`
  steps:
  - intent: greet
  - action: utter_greet | action based on utterance

stories:
- story: story to find a restaurant
  steps:
  - intent: find_restaurant
  - action: restaurant_form or custom action
  - action: utter_restaurant_found

@KvenS Now your actual answer using custom action, yes you can mention the custom action based on your bot/user conversations and even you need to consider the forms values you are using so you can activate and deactivate accordingly. I will suggest just give it a try. I hope you will able to archive your goal. If still we are here for your help :). Good Luck!