# Ignore optional slots in form depending on condition

**URL:** <https://forum.rasa.com/t/ignore-optional-slots-in-form-depending-on-condition/40835>\
**Category:** Rasa Open Source\
**Created:** [March 3, 2021, 2:15pm UTC](https://forum.rasa.com/t/ignore-optional-slots-in-form-depending-on-condition/40835 "2021-03-03T14:15:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya\_Nar](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Aditya\_Nar](https://forum.rasa.com/u/Aditya_Nar)\
**Post date:** [March 3, 2021, 2:15pm UTC](https://forum.rasa.com/t/ignore-optional-slots-in-form-depending-on-condition/40835/1 "2021-03-03T14:15:35Z")

</div>

Hi,

I am developing a security bot which has a form called security\_form with a series of questions used to determine the users’ identity. Each question has a specific score assigned to it, and once the bot reaches a score of 10, I have to exit the form.

After racking my brain for several days, I am unable to find an elegant solution to do this. So far I have explored two options: one, to fill the remaining slots manually in my validate action once the score is reached. However, this is hardly efficient as in case of a large number f slots, my code will become unmanageable.

Second is raising an ActionRejectionExecution, however, this too is not feasible as my bot will forget the most recent slot since I am not returning a SlotSet event.

Is there any way to solve this? Thanks in advance

---

<div class="post-metadata">

**Author:** ![kearnsw](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kearnsw/32/4838_2.png) [@kearnsw](https://forum.rasa.com/u/kearnsw)\
**Post date:** [March 3, 2021, 6:28pm UTC](https://forum.rasa.com/t/ignore-optional-slots-in-form-depending-on-condition/40835/2 "2021-03-03T18:28:09Z")

</div>

I’d recommend overriding the `required_slots` method to add your custom logic to dynamically set which slots are required. [Forms](https://rasa.com/docs/rasa/forms/#custom-slot-mappings)

---

<div class="post-metadata">

**Author:** ![Aditya\_Nar](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Aditya\_Nar](https://forum.rasa.com/u/Aditya_Nar)\
**Post date:** [March 3, 2021, 7:02pm UTC](https://forum.rasa.com/t/ignore-optional-slots-in-form-depending-on-condition/40835/3 "2021-03-03T19:02:10Z")

</div>

Hi Will,

Thanks for the quick response. I had a look at the docs and the Rasa GitHub code, and I think I understand the solution, but just to re- confirm, if I override the required slots method and pass the currently filled slot as the parameter, it should stop asking me for the remaining slots and will exit out of the form even if they are unfilled, right?

Will try it out once I get back to work. Thanks for the help! 🙂
