# Issues with dynamic form behavior -\> added slots mappings

**URL:** <https://forum.rasa.com/t/issues-with-dynamic-form-behavior-added-slots-mappings/61962>\
**Category:** Rasa Open Source\
**Created:** [May 15, 2024, 8:23am UTC](https://forum.rasa.com/t/issues-with-dynamic-form-behavior-added-slots-mappings/61962 "2024-05-15T08:23:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matlafu](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/matlafu/32/24220_2.png) [@matlafu](https://forum.rasa.com/u/matlafu)\
**Post date:** [May 15, 2024, 8:23am UTC](https://forum.rasa.com/t/issues-with-dynamic-form-behavior-added-slots-mappings/61962/1 "2024-05-15T08:23:30Z")

</div>

Hi, I´m working with a dynamic Form in Rasa 3.x. Depending on the user input I have to ask further questions, what is easily accomplished by dynamic form behavior in the ValidateFORMNAME Class → required\_slots function. Until now I have been ADDING slots whenever the condition is right.

However, I´m facing an issue. In the required slots function, I have an if statement that tests the value and adds a slot to the form like this:

```auto
        if tracker.slots.get("slotname") == "condition":
            additional_slots.append("slotname2")

```

this works, but I´m having issues with my mappings. Let´s say I define slotname2 as follows:

```auto
  slotname2:
    type: bool
    mappings:
      - type: from_intent
        intent: affirm
        value: true
        conditions:
          - active_loop: simple_lead_form
            requested_slot: slotname2
      - type: from_intent
        intent: deny
        value: false
        conditions:
          - active_loop: simple_lead_form
            requested_slot: slotname2

```

basically, whenever I´m asking for that specific slot in the form, when the user answers with anything positive, the slot will be “true”, and if the user answers with something negative, the slot will be “false”. This has proven to work really well for the slots that have been already defined as requested slots in the form, as I´m working basically with “yes/no” questions. However, whenever I map slots like this that aren´t included in the required\_slots of the form, I can´t train my model 🤨I get the following warnings:

```auto
UserWarning: Slot 'slotname2' has a mapping condition for form 'simple_lead_form', but it's not present in 'simple_lead_form' form's 'required_slots'. The slot needs to be added to this key.
Project validation completed with errors.

```

Is there a workaround for this? I could change the logic of my bot to add ALL of the slots and take them away from the form depending on the situation, but I´ve got around 400 slots. Is there another option for this? Maybe add all of the slots to the form and redefine the required slots in ActionSessionStart?

Thanks in advance! Any help is appreciated 🙂

---

<div class="post-metadata">

**Author:** ![deep](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/deep/32/24006_2.png) [@deep](https://forum.rasa.com/u/deep)\
**Post date:** [August 16, 2024, 1:54pm UTC](https://forum.rasa.com/t/issues-with-dynamic-form-behavior-added-slots-mappings/61962/2 "2024-08-16T13:54:34Z")

</div>

@matlafu Hi did you find any solution to this?

---

<div class="post-metadata">

**Author:** ![matlafu](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/matlafu/32/24220_2.png) [@matlafu](https://forum.rasa.com/u/matlafu)\
**Post date:** [August 22, 2024, 6:49am UTC](https://forum.rasa.com/t/issues-with-dynamic-form-behavior-added-slots-mappings/61962/3 "2024-08-22T06:49:16Z")

</div>

yeah, I ended up overwriting the form validation class so I can add all the slots to the form and only ask for them if a condition is met, kind of doing the opposite of what I was doing at the beginning. I use that new form validation class to validate the form I´m running. Maybe a simpler approach would be to add everythign to the form (while using the standard form validation class) and instead of add slots to the form, you delete them - although I´m not sure if that´s possible but it should be, imo -

---

<div class="post-metadata">

**Author:** ![deep](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/deep/32/24006_2.png) [@deep](https://forum.rasa.com/u/deep)\
**Post date:** [August 22, 2024, 7:19am UTC](https://forum.rasa.com/t/issues-with-dynamic-form-behavior-added-slots-mappings/61962/4 "2024-08-22T07:19:19Z")

</div>

oh. i see. thanks.
