# Rasa doesn't save slots

**URL:** <https://forum.rasa.com/t/rasa-doesnt-save-slots/36669>\
**Category:** \[Deprecated\] Rasa X Community Edition\
**Created:** [November 5, 2020, 10:57am UTC](https://forum.rasa.com/t/rasa-doesnt-save-slots/36669 "2020-11-05T10:57:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![orcam](https://avatars.discourse-cdn.com/v4/letter/o/b5a626/32.png) [@orcam](https://forum.rasa.com/u/orcam)\
**Post date:** [November 5, 2020, 10:57am UTC](https://forum.rasa.com/t/rasa-doesnt-save-slots/36669/1 "2020-11-05T10:57:45Z")

</div>

Hello, I’m new to Rasa and I have a problem with the slots and a custom action. I use Rasa 2.0 Open Source and Rasa X. I want to create a chatbot that creates a file using a Linux command. It’s in German. The user writes “Datei erstellen” (create file) and has to write after that the filename and filetype (these are the two slots, the filetype can be choosen by buttons). After that the Chatbot should call the actions.py where he creates the file (e.g. touch test.txt).

The problem is that the bot goes to action.listen() instead of calling my action “action\_create\_file”. I corrected it in Rasa X but there are no slots saved. For debugging reasons I have only printed down the slots without executing a touch command. The two slots are None.

**domain.yml:**

> ```
> Blockquote session_config:
> session_expiration_time: 60
> carry_over_slots_to_new_session: true
> intents:
> - create_file
> - entry_filetype
> - entry_filename
> - greet
> - goodbye
> - affirm
> - deny
> - whoami
> - bot_challenge
> - entry_filetype{"filetype":"txt"}
> - entry_filename{"filename":"Kontakte"}
> entities:
> - filename
> - filetype
> - is_directory
> slots:
> filename:
> type: text
> auto_fill: false
> influence_conversation: true
> filetype:
> type: text
> auto_fill: false
> influence_conversation: true
> is_directory:
> type: bool
> influence_conversation: true
> responses:
> utter_greet:
> - text: Hallo :)
> utter_goodbye:
> - text: Auf Wiedersehen :)
> utter_whoami:
> - text: Ich bin Kevin, ein Chatbot der FI-TS.
> utter_ask_filename:
> - text: Ich brauche noch den Dateinamen um die Datei zu erstellen.
> utter_ask_filetype:
> - buttons:
> - payload: /entry_filetype{{"filetype":"txt"}}
> title: Textdatei (.txt)
> - payload: /entry_filetype{{"filetype":"html"}}
> title: HTML Datei (.html)
> text: Ich brauche noch den Dateityp um die Datei zu erstellen.
> actions:
> - action_create_file
> - utter_ask_filename
> - utter_ask_filetype
> - utter_greet
> version: '2.0'
> 
> ```

**stories.yml:**

> version: “2.0”
> 
> stories:
> 
> - story: greeting
> 
> - story: Create file story
> 
> - story: Test Story Create file
> 
> - story: interactive\_story\_1

**nlu.yml:**

> - intent: create\_file
> 
> - intent: entry\_filename
> 
> - intent: entry\_filetype

**actions.py:**

> from typing import Any, Text, Dict, List
> 
> from rasa\_sdk import Action, Tracker
> 
> from rasa\_sdk.executor import CollectingDispatcher
> 
> from rasa\_sdk.events import SlotSet
> 
> import os
> 
> import subprocess
> 
> # DATEI ERSTELLEN
> 
> class ActionCreateFile(Action):
> 
> ```
> def name(self) -> Text:
> 
> return "action_create_file"
> 
> def run(self, dispatcher: CollectingDispatcher,
> 
> tracker: Tracker,
> 
> domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
> 
> #os.system('touch hello.txt')
> 
>     
> 
> fname = tracker.get_slot('filename')
> 
> ftype = tracker.get_slot('filetype')
> 
> print(fname)
> 
> print(ftype)
> 
> #dispatcher.utter_message(text="Hello.txt wurde erstellt :)")
> 
> message = "Datei {} {} wurde erstellt".format(fname, ftype)
> 
> dispatcher.utter_message(text=message)
> 
> # Konsolenausgabe in Rasa Shell ausgeben
> 
> #output = subprocess.check_output("date", shell=True)
> 
> #dispatcher.utter_message(text=str(output))
> 
> return [SlotSet("filename", fname), SlotSet("filetype", ftype)]
> 
> # return []
> 
> ```

 ![story1](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/f/f5d2fc5bf42637fb543d56408c0008b1e880c542.png) ![story2](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/c/c9b22963c0b39855161a8266b11bc0a840bfc7dd.png)

Again: The last action (action\_create\_file) is only called because I corrected it. Usually he just says action\_listen. And the slots are both “None”. So the created file is “None None” instead of "Kontakte txt). How can I fix this?

---

<div class="post-metadata">

**Author:** ![rctatman](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rctatman/32/6734_2.png) [@rctatman](https://forum.rasa.com/u/rctatman)\
**Post date:** [November 5, 2020, 10:24pm UTC](https://forum.rasa.com/t/rasa-doesnt-save-slots/36669/2 "2020-11-05T22:24:32Z")

</div>

> [@orcam](#):
>
> ```auto
> - entry_filetype
> - entry_filename
> - greet
> - goodbye
> - affirm
> - deny
> - whoami
> - bot_challenge
> - entry_filetype{"filetype":"txt"}
> - entry_filename{"filename":"Kontakte"}
> 
> ```

I think your problem might be the last entries in the intents section. It looks like you’re setting them with the buttons but not setting the intents “entry\_filetype” and “entry\_filename”, which are what you really want to be doing. The /intent{entity} syntax is only necessary in the definition of the actual buttons under responses. I thiiiink your problem may be resolved if you just delete those last two lines.

---

<div class="post-metadata">

**Author:** ![orcam](https://avatars.discourse-cdn.com/v4/letter/o/b5a626/32.png) [@orcam](https://forum.rasa.com/u/orcam)\
**Post date:** [November 9, 2020, 2:16pm UTC](https://forum.rasa.com/t/rasa-doesnt-save-slots/36669/3 "2020-11-09T14:16:16Z")

</div>

@rctatman Thank you. Now the bot asks the filetype instead of listening, but the slots are still “None”. Here is the story (I use Rasa X “Talk to your bot” for testing).

> version: “2.0” stories:
> 
> - story: Story from Conversation ID 989643b3272149269c4aded6111ff27c steps:
> - intent: create\_file
> - action: utter\_ask\_filename
> - intent: entry\_filename entities:
> - filename: Kontakte
> 
> - action: utter\_ask\_filetype
> - intent: entry\_filetype entities:
> - filetype: html
> 
> - action: action\_create\_file
> - slot\_was\_set:
> - filename: null
> 
> - slot\_was\_set:
> - filetype: null

---

<div class="post-metadata">

**Author:** ![rctatman](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rctatman/32/6734_2.png) [@rctatman](https://forum.rasa.com/u/rctatman)\
**Post date:** [November 9, 2020, 6:55pm UTC](https://forum.rasa.com/t/rasa-doesnt-save-slots/36669/4 "2020-11-09T18:55:25Z")

</div>

Mmm, hard to say what’s going on without more info. Do you have your Rasa & Action server logs?

---

<div class="post-metadata">

**Author:** ![orcam](https://avatars.discourse-cdn.com/v4/letter/o/b5a626/32.png) [@orcam](https://forum.rasa.com/u/orcam)\
**Post date:** [November 10, 2020, 8:42am UTC](https://forum.rasa.com/t/rasa-doesnt-save-slots/36669/5 "2020-11-10T08:42:07Z")

</div>

Where can I find them? If you mean the console log where I start rasa x, there are no errors.
