# Switching from one form to another

**URL:** <https://forum.rasa.com/t/switching-from-one-form-to-another/29521>\
**Category:** Rasa Open Source\
**Created:** [May 29, 2020, 10:05pm UTC](https://forum.rasa.com/t/switching-from-one-form-to-another/29521 "2020-05-29T22:05:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AniketBajpai](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@AniketBajpai](https://forum.rasa.com/u/AniketBajpai)\
**Post date:** [May 29, 2020, 10:05pm UTC](https://forum.rasa.com/t/switching-from-one-form-to-another/29521/1 "2020-05-29T22:05:59Z")

</div>

I have a simple form that enables a person to track his order with us. Before the form starts, I want to check if the logged\_in slot is set, and if it is not set, switch to the **login** form.

I would prefer that this behaviour be enforced by a rule and not an ML model. What would be the best way to implement the switch from one form to another?

Thanks!

---

<div class="post-metadata">

**Author:** ![GeovanaRamos](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/geovanaramos/32/9116_2.png) [@GeovanaRamos](https://forum.rasa.com/u/GeovanaRamos)\
**Post date:** [June 1, 2020, 7:44pm UTC](https://forum.rasa.com/t/switching-from-one-form-to-another/29521/2 "2020-06-01T19:44:21Z")

</div>

If you really want to use code for that, one option is to have some action to verify this condition and returns a FollowupAction. Try something like this:

```
class ActionVerifyLogin(Action):

    def name(self):
        return "action_verify_login"

    def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain):
        
        if not tracker.get_slot('logged_in'):
            return [FollowupAction('your_login_form')]
       
        return [FollowupAction('your_track_order_action')]
```
