# Nested slots

**URL:** <https://forum.rasa.com/t/nested-slots/15851>\
**Category:** Rasa Open Source\
**Created:** [September 18, 2019, 1:50pm UTC](https://forum.rasa.com/t/nested-slots/15851 "2019-09-18T13:50:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GauravRoy48](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gauravroy48/32/5063_2.png) [@GauravRoy48](https://forum.rasa.com/u/GauravRoy48)\
**Post date:** [September 18, 2019, 1:50pm UTC](https://forum.rasa.com/t/nested-slots/15851/1 "2019-09-18T13:50:36Z")

</div>

Can i have slots which can automatically fill other slots? This may sound confusing so here is an example with `2 categorical slots`.

> ```
> slot1:
> values:
> - abc
> - def
> 
> ```

> ```
> slot2:
> values:
> - abc123
> - abc456
> - def132
> - def456
> 
> ```

If i set slot2 to `def456`, can i set slot1 to `def`? I dont want to use the return method for SlotSet because i have lots of stories and lot more values per slot…

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [September 20, 2019, 3:36pm UTC](https://forum.rasa.com/t/nested-slots/15851/2 "2019-09-20T15:36:38Z")

</div>

Hm, don’t think so – what is your use case for this?

---

<div class="post-metadata">

**Author:** ![GauravRoy48](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gauravroy48/32/5063_2.png) [@GauravRoy48](https://forum.rasa.com/u/GauravRoy48)\
**Post date:** [September 20, 2019, 6:42pm UTC](https://forum.rasa.com/t/nested-slots/15851/3 "2019-09-20T18:42:11Z")

</div>

Departments and list of items per department. If the user wants to talk about a particular item, then i should also keep the department that the item belongs to.

---

<div class="post-metadata">

**Author:** ![erohmensing](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/erohmensing/32/1789_2.png) [@erohmensing](https://forum.rasa.com/u/erohmensing)\
**Post date:** [September 23, 2019, 8:18am UTC](https://forum.rasa.com/t/nested-slots/15851/4 "2019-09-23T08:18:56Z")

</div>

I think the best way would be to have one custom action that extracts the department from the item. So after your stories you would add an action like `action_get_department` which would basically have a dictionary of all the different items in the different departments, do a look up, and return the department slot. You wouldn’t have to write any extra stories or actions for the different departments, unless you want to change the dialogue based on the departnment (in which case you’d need multiple stories but not multiple actions).

If you decided to turn this flow into a form, you could indeed auto-populate the department slot during a `validate_item` function you’ve written for the form.

---

<div class="post-metadata">

**Author:** ![GauravRoy48](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/gauravroy48/32/5063_2.png) [@GauravRoy48](https://forum.rasa.com/u/GauravRoy48)\
**Post date:** [September 23, 2019, 9:36am UTC](https://forum.rasa.com/t/nested-slots/15851/5 "2019-09-23T09:36:42Z")

</div>

Thanks
