# Slot of type List only takes one element

**URL:** <https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756>\
**Category:** Rasa Open Source\
**Created:** [August 29, 2018, 8:17pm UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756 "2018-08-29T20:17:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonardoaii71](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/leonardoaii71/32/458_2.png) [@leonardoaii71](https://forum.rasa.com/u/leonardoaii71)\
**Post date:** [August 29, 2018, 8:17pm UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756/1 "2018-08-29T20:17:42Z")

</div>

Hello, I am filling a List Slot from a custom action but the slot is only storing one element.

Here are my slots in the Domain File:

```
 entities:
  - event
  - date

  slots:
  event:
    type: unfeaturized
  date:
    type: unfeaturized
  matching_events:
    type: list
  username:
    type: unfeaturized
    initial_value: "human"
```

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [September 3, 2018, 8:54am UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756/2 "2018-09-03T08:54:45Z")

</div>

What does your custom action look like?

---

<div class="post-metadata">

**Author:** ![leonardoaii71](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/leonardoaii71/32/458_2.png) [@leonardoaii71](https://forum.rasa.com/u/leonardoaii71)\
**Post date:** [September 4, 2018, 11:07pm UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756/3 "2018-09-04T23:07:35Z")

</div>

I solved the issue. Please delete this post.

---

<div class="post-metadata">

**Author:** ![Sandy](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Sandy](https://forum.rasa.com/u/Sandy)\
**Post date:** [September 5, 2018, 10:29am UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756/4 "2018-09-05T10:29:38Z")

</div>

HI Leonardo,Akela

Could you please let me know how you access elements from list slot? For example my custom action returns a list with 2 elements - [5,0] or [5,1] or [5,-1]. First element of the list is a value and send element tells me where it is equal to (0) , or greater than (1) or less than (-1) a certain threshold. If I do slot{l"listname":“listvalue”} I check the entire list, but what is I want to check only for second element of the list?

Thank you, Shruti

---

<div class="post-metadata">

**Author:** ![leonardoaii71](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/leonardoaii71/32/458_2.png) [@leonardoaii71](https://forum.rasa.com/u/leonardoaii71)\
**Post date:** [September 8, 2018, 4:41pm UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756/5 "2018-09-08T16:41:09Z")

</div>

Hello, I am assuming you want to access the element from python code.

For this task, you can use the tracker.get\_slot() method which returns the value of the slot.

In your case you would do something like:

```
list = tracker.get_slot("listName") #Returns the list in the slot "listName"
secondElement = list[1] #using the python indexing syntax

```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Sandy](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Sandy](https://forum.rasa.com/u/Sandy)\
**Post date:** [September 11, 2018, 10:53am UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756/6 "2018-09-11T10:53:28Z")

</div>

Thanks Leonardo, that was helpful!

---

<div class="post-metadata">

**Author:** ![milessmith](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@milessmith](https://forum.rasa.com/u/milessmith)\
**Post date:** [October 21, 2018, 4:17pm UTC](https://forum.rasa.com/t/slot-of-type-list-only-takes-one-element/756/7 "2018-10-21T16:17:07Z")

</div>

hey guys Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one. with regards mile smith [shareit](https://shareit.onl/)[UC browser](https://www.ucbrowser.vip/) [MX player](https://mxplayer.pro/)
