# Setting Slots from Dropdown in RASA

**URL:** <https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110>\
**Category:** Rasa Open Source\
**Created:** [September 29, 2021, 5:33pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110 "2021-09-29T17:33:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [September 29, 2021, 5:33pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110/1 "2021-09-29T17:33:37Z")

</div>

I need assistance with setting slots from dropdown options in RASA. Currently I’m using the dropdown from this Chatbot Widget [https://github.com/JiteshGaikwad/Chatbot-Widget/blob/main/docs/responses.md#dropdown](https://github.com/JiteshGaikwad/Chatbot-Widget/blob/main/docs/responses.md#dropdown)

However when i select the options from the webchat the slot is always set to None.

I have created slot in domain.yml,

```auto
slots:
  game_name:
    type: any

entities:
- game_name

```

and also created an intent

```auto
- intent: game_option
  examples: |
    - [Access Platc](game_name)
    - [Citk Platc](game_name)
    - [Diamond Platc](game_name)

```

and in stories.yml, I set this:

```auto
- intent: game_option
  - slot_was_set:
      - game_name

```

I dont understand why it’s still returning `None`

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 29, 2021, 5:40pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110/2 "2021-09-29T17:40:01Z")

</div>

Try to set autofill:

```auto
config:
  store_entities_as_slots: true

slots:
  game_name:
    type: any
    auto_fill: true

```

If it doesn’t work, please share the code for the response.

---

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [September 29, 2021, 5:48pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110/3 "2021-09-29T17:48:39Z")

</div>

@ChrisRahme I just tried it now, its not working. The response is from a custom action as below:

```auto
class ActionListGames(Action):
    def name(self) -> Text:
        return "action_list_games"

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

        response_games = requests.get("https://www.gamexn.com/api/v2/games")
        processed_output = json.load(io.BytesIO(response_games.content))['data']['games']

        games = [
            {
                "label": row['gameName'],
                "value": "/game_option{\"game_name\": \"" + row['gameCode'] + "\"}"
            } for row in processed_output
        ]
        message = {"payload": "dropDown", "data": games}

        dispatcher.utter_message(text="Please select a game option:", json_message=message)
        return []

```

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 29, 2021, 5:53pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110/4 "2021-09-29T17:53:33Z")

</div>

> [@segre\_dominic](#):
>
> `"/game_option{\"game_name\": \"" + row['gameCode'] + "\"}}"`

There is an extra closing bracket at the end there 🙂 Hopefully this is the culprit!

---

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [September 29, 2021, 5:56pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110/5 "2021-09-29T17:56:27Z")

</div>

@ChrisRahme Not really, I made that mistake while copying the code. Without the second bracket it still doesnt work.

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 29, 2021, 6:02pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110/6 "2021-09-29T18:02:34Z")

</div>

Oh well… I reviewed your code multiple times and it seems fine.

Try raising an [issue](https://github.com/JiteshGaikwad/Chatbot-Widget/issues) in the repo.

---

<div class="post-metadata">

**Author:** ![segre\_dominic](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@segre\_dominic](https://forum.rasa.com/u/segre_dominic)\
**Post date:** [September 29, 2021, 6:04pm UTC](https://forum.rasa.com/t/setting-slots-from-dropdown-in-rasa/48110/7 "2021-09-29T18:04:26Z")

</div>

oh ok. I will do just that. I have been wondering too. Thanks
