# Form Validation Not Running for Requested Slots

**URL:** <https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327>\
**Category:** Rasa Open Source\
**Created:** [June 11, 2019, 9:40pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327 "2019-06-11T21:40:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jabberlope](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jabberlope/32/3201_2.png) [@jabberlope](https://forum.rasa.com/u/jabberlope)\
**Post date:** [June 11, 2019, 9:40pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327/1 "2019-06-11T21:40:35Z")

</div>

Hi there, I have a form running that passes validation when I only require 2 slots, but when I require more I’m seeing that the follow-up questions for requested slots are not getting triggered.

I have followed the formbot pattern in the rasa examples folder.

Here is a dump of my actions server logs:

> 2019-06-11 16:28:46 DEBUG rasa\_sdk.forms - Extracted ‘iphone’ for extra slot ‘product’ 2019-06-11 16:28:46 DEBUG rasa\_sdk.forms - Extracted ‘broken’ for extra slot ‘condition’ 2019-06-11 16:28:46 DEBUG rasa\_sdk.forms - Validating extracted slots: {‘product’: ‘iphone’, ‘condition’: ‘broken’} 2019-06-11 16:28:46 DEBUG rasa\_sdk.forms - Request next slot ‘action’ 2019-06-11 16:28:46 DEBUG rasa\_sdk.executor - Finished running ‘product\_form’

Here is the validation in `actions.py`:

> ```
> @staticmethod
> def action_db() -> List[Text]:
> return ["return", "support"]
> 
> def validate_action(
> self,
> value: Text,
> dispatcher: CollectingDispatcher,
> tracker: Tracker,
> domain: Dict[Text, Any],
> ) -> Any:
> 
> if value.lower() in self.action_db():
> return {"action": value}
> else:
> dispatcher.utter_template("utter_wrong_action", tracker)
> return {"action": None}
> 
> ```

And here is the shell, where I’d expect the followup question to appear:

> ```
> (base) base ❯ rasa shell -v 
> /Users/a1451195/anaconda3/lib/python3.7/site-packages/dask/config.py:168: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
> data = yaml.load(f.read()) or {}
> 2019-06-11 16:28:37 INFO root - Starting Rasa Core server on http://localhost:5005
> Bot loaded. Type a message and press enter (use '/stop' to exit):
> Your input -> hi
> Thank you for choosing X Support, my name is Wendy. How may I assist you today?
> Your input -> my iphone is broken
> Your input ->
> 
> ```

Thanks for any help you can provide

---

<div class="post-metadata">

**Author:** ![jabberlope](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jabberlope/32/3201_2.png) [@jabberlope](https://forum.rasa.com/u/jabberlope)\
**Post date:** [June 12, 2019, 5:28pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327/2 "2019-06-12T17:28:01Z")

</div>

UPDATE: I came across one undodumented property of the forms object, that depends on adding something like this to your domain.yml

```
   utter_wrong_condition:
     - text: What condition is the product in?

```

This `utter_wrong_{slot}` pattern allows the form to respond when it needs the slot filled, but it is still not extracting the slot after I respond.

Also, I now see that the `vaildate_{slot}` method in your actions class (in actions.py) is only run when the slot is filled, not when it is empty.

What I’m still struggling with is how to fill slots that are empty on the first pass.

---

<div class="post-metadata">

**Author:** ![JulianGerhard](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juliangerhard/32/3781_2.png) [@JulianGerhard](https://forum.rasa.com/u/JulianGerhard)\
**Post date:** [June 12, 2019, 5:42pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327/3 "2019-06-12T17:42:52Z")

</div>

Hi @jabberlope

could you please uncomment the following part in the validate - method:

```
raise ActionExecutionRejection(
                            self.name(),
                            "Failed to extract slot {0} "
                            "with action {1}"
                            "".format(slot_to_fill, self.name()),
                        )

```

and instead add

`return []`

and check again what the form does?

Regards

---

<div class="post-metadata">

**Author:** ![jabberlope](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jabberlope/32/3201_2.png) [@jabberlope](https://forum.rasa.com/u/jabberlope)\
**Post date:** [June 12, 2019, 5:51pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327/4 "2019-06-12T17:51:31Z")

</div>

UPDATE 2: I was able to get the slots to validate in the form by removing the `auto_fill: false` from the slot objects.

From -\>

```
  condition:
    type: unfeaturized
    auto_fill: false

```

To -\>

```
  condition:
    type: unfeaturized
```

---

<div class="post-metadata">

**Author:** ![jabberlope](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jabberlope/32/3201_2.png) [@jabberlope](https://forum.rasa.com/u/jabberlope)\
**Post date:** [June 12, 2019, 5:52pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327/5 "2019-06-12T17:52:35Z")

</div>

I’ve seen the validate method in the rasa\_sdk, is that what you’re talking about?

None of the bot examples include a validate method in their Form Class.

---

<div class="post-metadata">

**Author:** ![JulianGerhard](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juliangerhard/32/3781_2.png) [@JulianGerhard](https://forum.rasa.com/u/JulianGerhard)\
**Post date:** [June 12, 2019, 5:54pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327/6 "2019-06-12T17:54:13Z")

</div>

It was put in the FormAction parent class. You could just overwrite it in the derived class or quickly change it in the FormAction class.

Maybe I faced a similar issue - that’s why I am asking.

---

<div class="post-metadata">

**Author:** ![jabberlope](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jabberlope/32/3201_2.png) [@jabberlope](https://forum.rasa.com/u/jabberlope)\
**Post date:** [June 12, 2019, 6:13pm UTC](https://forum.rasa.com/t/form-validation-not-running-for-requested-slots/11327/7 "2019-06-12T18:13:08Z")

</div>

I’m not having that issue anymore now that I’ve removed the `auto_fill` property off the slot.
