# Extract form slots correctly

**URL:** <https://forum.rasa.com/t/extract-form-slots-correctly/44634>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [June 15, 2021, 8:24am UTC](https://forum.rasa.com/t/extract-form-slots-correctly/44634 "2021-06-15T08:24:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThomasGoehringer](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@ThomasGoehringer](https://forum.rasa.com/u/ThomasGoehringer)\
**Post date:** [June 15, 2021, 8:24am UTC](https://forum.rasa.com/t/extract-form-slots-correctly/44634/1 "2021-06-15T08:24:37Z")

</div>

I have made a form, which should ask for several slots to change the delivery address of an order. Here is how it is configured:

**domain.yml**

```
slots:
  order_number:
    type: text
    auto_fill: false
    influence_conversation: false
  name:
    type: text
    auto_fill: false
    influence_conversation: false
  street:
    type: text
    auto_fill: false
    influence_conversation: false
  city:
    type: text
    auto_fill: false
    influence_conversation: false
  zip:
    type: text
    auto_fill: false
    influence_conversation: false
forms:
  change_delivery_address_form:
    city:
    - entity: city
      type: from_entity
    name:
    - entity: name
      type: from_entity
    order_number:
    - entity: order_number
      type: from_entity
    street:
    - entity: street
      type: from_entity
    zip:
    - entity: zip
      type: from_entity

```

I have an intent where I can already set the order\_number via the intent. This is working fine so far. However, when the other slots are being requested, the order\_number is overridden. The problem is, that rasa recognizes the zip code for example as the order\_number. The same thing happens with the street. When answering with “Somestreet 23”, Rasa extracts the 23 and sets it as the order number.

How do I need to set my form up, so Rasa asks for all the required slots and sets them correctly?

---

<div class="post-metadata">

**Author:** ![kalkbrennerei](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kalkbrennerei/32/11609_2.png) [@kalkbrennerei](https://forum.rasa.com/u/kalkbrennerei)\
**Post date:** [June 16, 2021, 8:23am UTC](https://forum.rasa.com/t/extract-form-slots-correctly/44634/2 "2021-06-16T08:23:30Z")

</div>

Hi @ThomasGoehringer!

I think this problem is about your slots being unique. From [rasa docs](https://rasa.com/docs/rasa/forms/):

> “when an extracted entity uniquely maps onto a slot, the slot will be filled even if this slot wasn’t requested by the form”

and an example here:

> “entity `city` without a role can fill both `departure_city` and `arrival_city` slots, depending which one is requested, so if an entity `city` is extracted when slot `arrival_date` is requested, it’ll be ignored by the form”

I can imagine that if you define an entity `number` and another slot `street_number`, then the entity `number` will not uniquely maps onto `order_number` anymore. Probably this would also influence the zip code.

Also I think that you would want to add `required_slots:` to your form.

Let me know if I understood the problem correctly and if this helps!!

---

<div class="post-metadata">

**Author:** ![ThomasGoehringer](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@ThomasGoehringer](https://forum.rasa.com/u/ThomasGoehringer)\
**Post date:** [June 17, 2021, 9:25am UTC](https://forum.rasa.com/t/extract-form-slots-correctly/44634/4 "2021-06-17T09:25:26Z")

</div>

Thanks for your answer. My question is more general. I understand a form as a simple question/answer way of asking for specific data. So with this unique mapping in mind, that from\_entity brings with it, what is generally best practice to extract the correct information in a form with similar slots like order\_number and zip?

---

<div class="post-metadata">

**Author:** ![kalkbrennerei](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kalkbrennerei/32/11609_2.png) [@kalkbrennerei](https://forum.rasa.com/u/kalkbrennerei)\
**Post date:** [July 22, 2021, 3:08pm UTC](https://forum.rasa.com/t/extract-form-slots-correctly/44634/5 "2021-07-22T15:08:10Z")

</div>

Hi @ThomasGoehringer! Sorry for the late reply! But maybe if you’re still interested, you can read about entity roles and groups (documented [here](https://rasa.com/docs/rasa/nlu-training-data/#entities-roles-and-groups)).
