# Slot values being overwritten in Rasa

**URL:** <https://forum.rasa.com/t/slot-values-being-overwritten-in-rasa/48231>\
**Category:** Rasa Open Source\
**Created:** [October 5, 2021, 4:52pm UTC](https://forum.rasa.com/t/slot-values-being-overwritten-in-rasa/48231 "2021-10-05T16:52:08Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![maseh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/maseh/32/20129_2.png) [@maseh](https://forum.rasa.com/u/maseh)\
**Post date:** [April 6, 2022, 3:05pm UTC](https://forum.rasa.com/t/slot-values-being-overwritten-in-rasa/48231/21 "2022-04-06T15:05:34Z")

</div>

Hi Afnaan, I had a similar problem with two integer slots that are similar and were overwriting each other: account number and transfer amount. What I did was create one entity called “number” with two roles, one for “account number” and one for “transfer amount”. In my nlu.yml, I put all examples of these entities in a single “inform” intent. I allowed the nlu to identify the number entity without any role attached to it when only a number was given, as well as more detailed examples with entity and role identified:

```auto
nlu:
- intent: inform
  examples: |
    - [1]{"entity": "number"}
    - [2]{"entity": "number"}
    - [3]{"entity": "number"}
    - [4]{"entity": "number"}
    - [5]{"entity": "number"}
    - [100]{"entity": "number"}
    - [2567]{"entity": "number"}
    - [721321567]{"entity": "number"}
    - [534412]{"entity": "number"}
    - I want to send [333]{"entity": "number", "role": "transfer_amount"}
    - Send to [2]{"entity": "number", "role": "transfer_recipient"}

```

I then set up my slots to extract from the number entity when the role was identified (i.e. when the user said “account 3” for example) and to extract from the number entity when no role was identified (i.e. when the user just said “3”) under the condition that my form was active and the requested slot was the respective slot. See below.

```auto
slots:
  transfer_recipient:
    type: text
    influence_conversation: true
    mappings:
    - type: from_entity
      entity: number
      role: transfer_recipient
    - type: from_entity
      entity: number
      conditions:
      - active_loop: send_transfer_form
        requested_slot: transfer_recipient
  transfer_amount:
    type: text
    influence_conversation: true
    mappings:
    - type: from_entity
      entity: number
      role: transfer_amount
    - type: from_entity
      entity: number
      conditions:
      - active_loop: send_transfer_form
        requested_slot: transfer_amount

```

Caveat that I’m new to rasa, but this has been working for me so far.

---

<div class="post-metadata">

**Author:** ![BrownMunda](https://avatars.discourse-cdn.com/v4/letter/b/e36b37/32.png) [@BrownMunda](https://forum.rasa.com/u/BrownMunda)\
**Post date:** [December 27, 2023, 1:58pm UTC](https://forum.rasa.com/t/slot-values-being-overwritten-in-rasa/48231/22 "2023-12-27T13:58:09Z")

</div>

Hi, I had the same problem. It turned out that while validating the slots in actions.py, I was returning the other slot to be set. eg: in my case i had place and budget as slots, in budget i was returning this: return {“place”: slot\_value}. So make sure you keep this in mid. Hope this helps

[Previous page](https://forum.rasa.com/t/slot-values-being-overwritten-in-rasa/48231.md?page=1)
