# Trigger default actions from form validation rasa 2

**URL:** <https://forum.rasa.com/t/trigger-default-actions-from-form-validation-rasa-2/50450>\
**Category:** Rasa Open Source\
**Created:** [January 7, 2022, 1:16pm UTC](https://forum.rasa.com/t/trigger-default-actions-from-form-validation-rasa-2/50450 "2022-01-07T13:16:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NIkhilBhaskar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbhaskar/32/18420_2.png) [@NIkhilBhaskar](https://forum.rasa.com/u/NIkhilBhaskar)\
**Post date:** [January 7, 2022, 1:16pm UTC](https://forum.rasa.com/t/trigger-default-actions-from-form-validation-rasa-2/50450/1 "2022-01-07T13:16:48Z")

</div>

Hi, I am using rasa 2.8 I want to trigger actions like UserUttered or ActionExecuted from form validation

```auto
class ValidateApplyLeavesForm(FormValidationAction):
    
    def name(self):
        return "validate_apply_leave_form"

    def validate_fromDate(self, slot_value: Any, dispatcher,tracker,domain):
     
        #change intent based on last msg or exit keyword
        lastMsg = tracker.latest_message['text']
        lastIntent = tracker.latest_message['intent']['name']
        lastIntent_confidence = tracker.latest_message['intent']['confidence']

        if lastIntent != 'apply_leave':
            if lastMsg.lower() == 'exit':
                dispatcher.utter_message('Form exited')
                #reset all slots and deactivate form
                return {'fromDate':None,'toDate':None,'lvType':None,'leave_reason':None,'is_first_half':None,'is_second_half':None,'half_day_detected':None,'is_planned':None,'num_days':None,'requested_slot':None} 

```

like I deactivated this form from validation, can I also trigger UserUttered and ActionExecuted in same way?

---

<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:** [January 8, 2022, 7:42pm UTC](https://forum.rasa.com/t/trigger-default-actions-from-form-validation-rasa-2/50450/2 "2022-01-08T19:42:48Z")

</div>

You can set some special slot, and then write a story that triggers an action when that slot is set from the form.

This action will itself call the events you desire (and reset that special slot).

---

<div class="post-metadata">

**Author:** ![NIkhilBhaskar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbhaskar/32/18420_2.png) [@NIkhilBhaskar](https://forum.rasa.com/u/NIkhilBhaskar)\
**Post date:** [January 10, 2022, 5:33am UTC](https://forum.rasa.com/t/trigger-default-actions-from-form-validation-rasa-2/50450/3 "2022-01-10T05:33:58Z")

</div>

> [@ChrisRahme](#):
>
> You can set some special slot, and then write a story that triggers an action when that slot is set from the form.

How do I trigger an action when a slot is set?

---

<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:** [January 10, 2022, 6:26am UTC](https://forum.rasa.com/t/trigger-default-actions-from-form-validation-rasa-2/50450/4 "2022-01-10T06:26:09Z")

</div>

As I said, from a story 🙂

Read about [Slot Events](https://rasa.com/docs/rasa/stories#slot-events).
