# Whats the use of active\_loop in stories and rules

**URL:** <https://forum.rasa.com/t/whats-the-use-of-active-loop-in-stories-and-rules/45874>\
**Category:** Rasa Open Source\
**Created:** [July 18, 2021, 7:59pm UTC](https://forum.rasa.com/t/whats-the-use-of-active-loop-in-stories-and-rules/45874 "2021-07-18T19:59:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pvbhanuteja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/pvbhanuteja/32/7189_2.png) [@pvbhanuteja](https://forum.rasa.com/u/pvbhanuteja)\
**Post date:** [July 18, 2021, 7:59pm UTC](https://forum.rasa.com/t/whats-the-use-of-active-loop-in-stories-and-rules/45874/1 "2021-07-18T19:59:44Z")

</div>

Can someone help me understand difference between these 3 stories

```
- story: 1
  steps:
  - intent : greet
  - action : utter_greet
  - intent : ask_about_specials
  - action : utter_specials_info
  - action : restaurant_specials_form
  - action: utter_submit

- story: 2
  steps:
  - intent : greet
  - action : utter_greet
  - intent : ask_about_specials
  - action : utter_specials_info
  - action : restaurant_specials_form
  - active_loop: null
  - action: utter_submit

- story: 3
  steps:
  - intent : greet
  - action : utter_greet
  - intent : ask_about_specials
  - action : utter_specials_info
  - action : restaurant_specials_form
  - active_loop : restaurant_specials_form
  - active_loop: null
  - action: utter_submit
```

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [July 18, 2021, 8:05pm UTC](https://forum.rasa.com/t/whats-the-use-of-active-loop-in-stories-and-rules/45874/2 "2021-07-18T20:05:55Z")

</div>

@pvbhanuteja See this linked video and you will be expert in active-loop and form [https://youtu.be/U3an88fjFRc](https://youtu.be/U3an88fjFRc) .Good Luck!

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [July 18, 2021, 8:08pm UTC](https://forum.rasa.com/t/whats-the-use-of-active-loop-in-stories-and-rules/45874/3 "2021-07-18T20:08:28Z")

</div>

The use of `active_loop: null` followed by `action: utter_submit` tell the bot that once a form is completed (aka all the required slots have been filled), it should execute `utter_submit`.

To start a form, I would suggest doing this:

```auto
- story: Activate form
  - intent : ask_about_specials
  - action : utter_specials_info
  - action : restaurant_specials_form
  - active_loop : restaurant_specials_form # Stay in the form while all the required slots have not been filled

```

And to stop it, I would suggest doing it in a separate story (or rule):

```auto
- rule: Submit form
  condition: # Condition that the loop is active, aka still in the form
  - active_loop: restaurant_specials_form
  steps:
  - action: restaurant_form
  - active_loop: null # The form has been completed
  - slot_was_set:
    - requested_slot: null # All the required slots have been filled
  - action: utter_submit

```

Look at [Activating a Form](https://rasa.com/docs/rasa/forms/#activating-a-form) and [Dectivating a Form](https://rasa.com/docs/rasa/forms/#deactivating-a-form) in the Docs. The video suggested by @nik202 is also good 🙂
