# End of form

**URL:** <https://forum.rasa.com/t/end-of-form/31596>\
**Category:** Rasa Open Source\
**Created:** [July 20, 2020, 11:38pm UTC](https://forum.rasa.com/t/end-of-form/31596 "2020-07-20T23:38:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![argideritzalpea](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/argideritzalpea/32/7528_2.png) [@argideritzalpea](https://forum.rasa.com/u/argideritzalpea)\
**Post date:** [July 20, 2020, 11:38pm UTC](https://forum.rasa.com/t/end-of-form/31596/1 "2020-07-20T23:38:13Z")

</div>

What is the preferred method for ensuring that the conclusion of filling a form out entirely (getting to the end of it) deterministically triggers another action? I see that when my form is expended, the following are returned in my stories:

```auto
form{"name":null}
slot{"requested_slot":null}

```

Is there a way to ensure this triggers another action?

Thank you.

---

<div class="post-metadata">

**Author:** ![saurabh-m523](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/saurabh-m523/32/7887_2.png) [@saurabh-m523](https://forum.rasa.com/u/saurabh-m523)\
**Post date:** [July 21, 2020, 4:40am UTC](https://forum.rasa.com/t/end-of-form/31596/2 "2020-07-21T04:40:49Z")

</div>

Hi @argideritzalpea!

Though it is preferred that, you mention the action which you want to call after the form, in your stories. But if you want to force some action, you can return a `FollowupAction()` event from the `submit()` method of your form. See [Force a followup action](https://rasa.com/docs/rasa/api/events/#force-a-followup-action) for more details.

---

<div class="post-metadata">

**Author:** ![argideritzalpea](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/argideritzalpea/32/7528_2.png) [@argideritzalpea](https://forum.rasa.com/u/argideritzalpea)\
**Post date:** [July 21, 2020, 2:51pm UTC](https://forum.rasa.com/t/end-of-form/31596/3 "2020-07-21T14:51:52Z")

</div>

I am aware of follow up actions. I only want the followupAction to trigger at the end of the end of the form, so your suggestion wouldn’t work I don’t think.

Looks like I can overwrite the `request_next_slot` function.

It would be great if there were a more ‘macro’-level option for this instead of overwriting the return value of the function and adding it to the custom action server. The more hard-coded logic the user needs to create, the harder the upkeep and debugging down the road.

---

<div class="post-metadata">

**Author:** ![saurabh-m523](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/saurabh-m523/32/7887_2.png) [@saurabh-m523](https://forum.rasa.com/u/saurabh-m523)\
**Post date:** [July 21, 2020, 3:48pm UTC](https://forum.rasa.com/t/end-of-form/31596/4 "2020-07-21T15:48:41Z")

</div>

> [@argideritzalpea](#):
>
> I only want the followupAction to trigger at the end of the end of the form

Yeah so like I said, you have to return the `FollowupAction()` event from the `submit()` method of your form. The `submit()` method is called at the very end of the form. So, it should work.

Btw, how are you planning to use the `request_next_slot` method?

---

<div class="post-metadata">

**Author:** ![argideritzalpea](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/argideritzalpea/32/7528_2.png) [@argideritzalpea](https://forum.rasa.com/u/argideritzalpea)\
**Post date:** [July 21, 2020, 4:07pm UTC](https://forum.rasa.com/t/end-of-form/31596/5 "2020-07-21T16:07:26Z")

</div>

Hey, you are right! I was thrown off by the fact that in the stories, the form is seemingly called each time a slot is filled. I thought that that would trigger the followup at the conclusion of each slot fill. Thanks for your confirmation!

---

<div class="post-metadata">

**Author:** ![argideritzalpea](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/argideritzalpea/32/7528_2.png) [@argideritzalpea](https://forum.rasa.com/u/argideritzalpea)\
**Post date:** [July 22, 2020, 3:25pm UTC](https://forum.rasa.com/t/end-of-form/31596/6 "2020-07-22T15:25:10Z")

</div>

@saurabh-m523 Hey, I was wondering if you happened to know how to solve the following situation:

My main goal is to allow the user to speak at the end of the form while the bot listens, but does nothing (since the form has ended). Then, after a time delay, I want the conversation session to restart.

I tried setting up this functionality with the “reminders” function, but the bot is NOT delaying in restarting the session:

relevant `domain.yml`:

```auto
intents:
  - goodbye
  - TIMED_RESTART: {triggers: action_session_start}
actions:
  - action_session_start
  - utter_goodbye

```

Relevant actions:

```auto
class ActionGoodbye(Action):
    """Resets convo"""

    def name(self):
        return "utter_goodbye"

    async def run(self, dispatcher, tracker, domain):

        date = datetime.datetime.now() + datetime.timedelta(seconds=50)

        reminder = ReminderScheduled(
            "TIMED_RESTART",
            trigger_date_time=date,
            name="restart_reminder",
            kill_on_user_message=False,
        )

class ActionSessionStart(Action):
    def name(self) -> Text:
        return "action_session_start"

    @staticmethod
    def fetch_slots(tracker: Tracker) -> List[EventType]:
        """Collect slots that contain the user's name and phone number."""

        slots = []
        for key in ("zipCode", "yearBorn"):
            value = tracker.get_slot(key)
            if value is not None:
                slots.append(SlotSet(key=key, value=value))
        return slots

    async def run(
        self,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
    ) -> List[EventType]:

        # the session should begin with a `session_started` event
        events = [SessionStarted()]

        # any slots that should be carried over should come after the
        # `session_started` event
        events.extend(self.fetch_slots(tracker))

        # an `action_listen` should be added at the end as a user message follows
        events.append(ActionExecuted("action_listen"))

        return events

```

Anyone know how to get this working in Rasa ?

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [August 5, 2020, 12:16am UTC](https://forum.rasa.com/t/end-of-form/31596/7 "2020-08-05T00:16:50Z")

</div>

Can you show the log from when you call the `utter_goodbye` action.
