# How do we access list slot is rasa custom actions?

**URL:** <https://forum.rasa.com/t/how-do-we-access-list-slot-is-rasa-custom-actions/57446>\
**Category:** Rasa Open Source\
**Created:** [March 6, 2023, 8:00am UTC](https://forum.rasa.com/t/how-do-we-access-list-slot-is-rasa-custom-actions/57446 "2023-03-06T08:00:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadhir\_Hasan](https://avatars.discourse-cdn.com/v4/letter/n/7bcc69/32.png) [@Nadhir\_Hasan](https://forum.rasa.com/u/Nadhir_Hasan)\
**Post date:** [March 6, 2023, 8:00am UTC](https://forum.rasa.com/t/how-do-we-access-list-slot-is-rasa-custom-actions/57446/1 "2023-03-06T08:00:00Z")

</div>

is there any way to append and remove values from a list slot. because when i access the list slot by `current_list = tracker.get_slot("ques_order")` and utter, it will return None instead of list. how i manage this problem.

this how i created the list slot;

```auto
ques_order:
    type: list
    influence_conversation: false
    mappings:
    - type: custom

```

---

<div class="post-metadata">

**Author:** ![NikolaMr](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikolamr/32/22347_2.png) [@NikolaMr](https://forum.rasa.com/u/NikolaMr)\
**Post date:** [March 9, 2023, 9:41am UTC](https://forum.rasa.com/t/how-do-we-access-list-slot-is-rasa-custom-actions/57446/2 "2023-03-09T09:41:11Z")

</div>

Hi Nadhir,

the behaviour you’re explaining is the default since you haven’t set list to anything so it is set to `None`.

You can change the initial value by setting `initial_value` property when defining the slot.

I see that you have custom mapping set for the slot so I guess you’d like to modify it through code. To do so you can use something like this:

```auto
class ActionCheckRestaurants(Action):
   def name(self) -> Text:
      return "action_check_restaurants"

   def run(self,
           dispatcher: CollectingDispatcher,
           tracker: Tracker,
           domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

      cuisine = tracker.get_slot('cuisine')
      q = "select * from restaurants where cuisine='{0}' limit 1".format(cuisine)
      result = db.query(q)

      return [SlotSet("matches", result if result is not None else [])]

```

Please note the `SlotSet` portion. With this event you’re able to set your `ques_order` to any list value you’d like.

Let me know if this answers your question and if I can assist you any further.

Regards, Nikola
